목록C++ (131)
정화 코딩

https://www.acmicpc.net/problem/30804 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector a(n); for (int i = 0; i > a[i]; int si = 0; int ei = 0; int maxcnt = 0; int cnt = 0; set chk; while (chk.size() maxcnt) maxcnt = cnt; } } while (chk.size() ..

https://www.acmicpc.net/problem/7662 #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int k; cin >> k; int cnt = 0; priority_queue maxq; priority_queue minq; while (k--) { char op; int x; cin >> op >> x; if..

https://www.acmicpc.net/problem/12761 #include #include #include using namespace std;bool vst[1000001];int dir[] = {-1, 1, 0, 0, 0, 0};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a, b, n, m; cin >> a >> b >> n >> m; dir[2] = a; dir[3] = a * (-1); dir[4] = b; dir[5] = b * (-1); queue> q; q.emplace(n, 0); vst[n] = true; while (!q.e..

https://www.acmicpc.net/problem/25333 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int a, b, x; cin >> a >> b >> x; vector chk(x + 1, false); queue q; q.push(0); chk[0] = true; int cnt = 0; while (!q.empty()) { i..

https://www.acmicpc.net/problem/11727 #include #include using namespace std;int mod = 10007;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector dp(n + 1, 0); dp[1] = 1; if (n > 1) dp[2] = 3; for (int i = 3; i 점화식: dp[n] = (2 * dp[n - 2] + dp[n - 1]) % mod(n - 2)까지 채운 것에 1 * 2 타일 2개 또는 2 * 2 타일 1개 붙이기 + (n - 1)까지 채운 것에 1 * 2 타일 1개..

https://www.acmicpc.net/problem/7696 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); while (true) { int n; cin >> n; if (n == 0) break; int i = 1; while (i chk(10, false); while (tmp > 0) { if (chk[tmp % 10]) { eq = true; ..

https://www.acmicpc.net/problem/2638 #include #include #include using namespace std;int dx[] = {1, -1, 0, 0};int dy[] = {0, 0, 1, -1};int n, m;vector> g;bool bfs() { vector> vst(n, vector(m, false)); vector> out(n, vector(m, false)); bool finish = true; queue> q; q.emplace(0, 0); vst[0][0] = true; while (!q.empty()) { int curi = q.front().first; int curj = q.fr..

https://www.acmicpc.net/problem/17939 #include #include using namespace std;int n;vector c;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; c = vector(n); for (int i = 0; i > c[i]; int ans = 0; int s = 0; int e = c.size(); while (s = maxv) { maxv = c[i]; maxi = i; } } for (int i = s;..