목록Algorithm (154)
cgy12306
// https://www.acmicpc.net/problem/11727 // 2xn 타일링 2 #include using namespace std; int dp[1001]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; dp[1] = 1; dp[2] = 3; for (int i = 3; i
#include using namespace std; int dp[1001]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; dp[1] = 1; dp[2] = 2; for (int i = 3; i
#include #include #include using namespace std; int DP[1000001] = { 0, }; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int X, a, b, c; cin >> X; DP[1] = 0; DP[2] = 1; DP[3] = 1; for (int i = 4; i
#include #include #include using namespace std; int arr[1001][1001] = { 0, }; int visit[1001]; int n, m; queue q; void dfs(int v) { cout v; for (int i = 0; i > x >> y; arr[x][y] = 1; arr[y][x] = 1; } dfs(v); cout
#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, DP[12] ,T; cin >> n; DP[1] = 1; DP[2] = 2; DP[3] = 4; for (int i = 0; i > T; for (int j = 4; j
#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int E, S, M, year = 1; cin >> E >> S >> M; while (!(E == 1 && S == 1 && M == 1)) { E--; S--; M--; if (E == 0) E = 15; if (S == 0) S = 28; if (M == 0) M = 19; year++; } cout
#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, K, a, A[21] = { 0, }; char comma; cin >> N >> K; cin >> A[0]; for (int j = 1; j > comma >> a; A[j] = a; } for (int i = 0; i < K; i++) { for (int j = 0; j < N - i - 1; j++) { A[j] = A[j + 1] - A[j]; } } cout