[백준] 11053번: 가장 긴 증가하는 부분 수열 (JavaScript)
·
PS
문제https://www.acmicpc.net/problem/11053 개념동적 계획법(DP)   구현 코드(JavaScript)const fs = require('fs');// 백준 제출용let input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');// 로컬 테스트용// const filePath =// process.platform === 'linux' ? '/dev/stdin' : __dirname + '/input.txt';// const input = fs.readFileSync(filePath).toString().trim().split('\n');const n = Number(input[0]);const arr = inp..
[백준] 1463번: 1로 만들기
·
PS
문제https://www.acmicpc.net/problem/1463    실행 결과     코드(c++)#include #include #include using namespace std;int main() { // 실행 시간 줄이기 ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; // 숫자 i를 1로 만드는데 필요한 최소 연산횟수를 저장하는 테이블 선언 및 초기화 vector dp(n + 1, 0); // 첫번째는 연산 필요 없으므로 0으로 설정 dp[1] = 0; for (int i = 2; i     코드 설명 초기에 잘못 생각했던 부분은 연산의 순서였다.dp 개념을 몰랐을때는 ..