C++ 썸네일형 리스트형 [C++]백준 알고리즘 19532번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #include using namespace std; int main(){ int a,b,c,d,e,f; cin >>a>>b>>c>>d>>e>>f; float x,y; y = (c*d-a*f)/(b*d-a*e); x = (b*f-c*e)/(b*d-a*e); cout 더보기 [C++]백준 알고리즘 1463번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #include using namespace std; int count[1000001]; void solve(int); int min(int a, int b){ return a>b? b:a; } int main(){ int n; cin >> n; solve(n); cout 9->3->1의 방법으로 3번이 최소 횟수이다. 이런 사고 과정을 통해 알고리즘을 다르게 짜야됨을 깨달았다. 그래서 여기서 사용하기로 한 방법은 DP인데 Bottom up 방식과 Top down 방식 중에서 Bottom up 방식을 이.. 더보기 [C++]백준 알고리즘 2246번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 #include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; //allocation int** condo = new int*[n]; for(int i=0; i condo[i][0] >> condo [i][1] ; } int count = 0; bool.. 더보기 [C++]백준 알고리즘 10871번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #include #include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,x; cin >> n >> x; int* a = new int[n]; vector b; for(int i=0; i> a[i]; if (a[i] 더보기 [C++]백준 알고리즘 2439번 풀이는 아래와 같다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; for(int i=0; i 더보기 이전 1 2 3 4 5 6 다음