본문 바로가기

알고리즘74

백준 2178번 : 미로 탐색 문제 링크 : www.acmicpc.net/problem/2178 풀이에 참고한 링크 : www.acmicpc.net/board/view/12343 내 풀이(2021.1.24) : #include #include #include using namespace std; int map[101][101]; int N, M; int dy[4] = { -1,0,1,0 }; int dx[4] = { 0,-1,0,1 }; void show() { for (int i = 1; i 2021. 1. 24.
백준 17626번 : Four Squares 문제 링크 : www.acmicpc.net/problem/17626 내 풀이1(2021.1.22.) : #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; bool stop = false; int a, b, c, d; for (a = 0; a < 224; a++) { for (b = a; b < 224; b++) { for (c = b; c < 224; c++) { for (d = c; d < 224; d++) { if (a * a + b * b + c * c + d * d == n) { stop = true; break; } } if.. 2021. 1. 22.
백준 9375번 : 패션왕 신해빈 문제 링크 : www.acmicpc.net/problem/9375 내 풀이(2021.1.22.) : #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int T; cin >> T; for (int i = 0; i > n; for (int i = 0; i > temp >> temp2; if (m.find(temp2) == m.end()) m[temp2] = 1; else m[temp2] = m[temp2] + 1; //cout 2021. 1. 22.
백준 2579번 : 계단 오르기 문제 링크 : www.acmicpc.net/problem/2579 풀이에 참고한 링크 : sihyungyou.github.io/baekjoon-2579/ 내 풀이(2021.1.22.) : #include #include using namespace std; int score[300]; int dp[300]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N; cin >> N; for (int i = 0; i > score[i]; } dp[0] = score[0]; dp[1] = score[0] + score[1]; dp[2] = max(score[0], score[1]) + .. 2021. 1. 22.