목록분류 전체보기 (189)
정화 코딩
https://www.acmicpc.net/problem/1821 #include #include using namespace std;vector fact;vector ans;vector mul;vector chk;int n, f;bool fin = false;void dfs(int idx, int res) { if (fin || res > f) { return; } if (idx == n) { if (res == f) { for (int x: ans) { cout > n >> f; fact = vector(n, 1); ans = vector(n); mul = vector(n); chk = vec..
task.json{ "version": "2.0.0", "runner": "terminal", "type": "shell", "echoCommand": true, "presentation": { "reveal": "always" }, "tasks": [ { "label": "save and compile for C++", "command": "g++", "args": [ "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" ], ..
https://www.acmicpc.net/problem/1821 #include #include using namespace std;vector fact;vector ans;vector mul;vector chk;int n, f;bool fin = false;void dfs(int idx, int res) { if (fin || res > f) { return; } if (idx == n) { if (res == f) { for (int x: ans) { cout > n >> f; fact = vector(n, 1); ans = vector(n); mul = vector(n); chk = vec..
https://www.acmicpc.net/problem/15991 #include using namespace std;int mod = 1000000009;long long s[100001] = {0};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); s[1] = 1; s[2] = 2; s[3] = 4; for (int i = 4; i > t; for (int tn = 0; tn > n; long long ans = 0; if (n == 1 || n == 2) { ans = n; } else if (n == 3) { ..
https://www.acmicpc.net/problem/29714 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; int total = n; map ic; for (int i = 0; i > tmp; if (ic.find(tmp) == ic.end()) { ic.insert({tmp, 1}); } else { ic[tmp]++; } } int q; cin >> q; for..
https://www.acmicpc.net/problem/15812 #include #include #include using namespace std;int dx[] = {-1, 1, 0, 0};int dy[] = {0, 0, -1, 1};int n, m;vector> og;vector> g;vector> vst;bool chk() { for (int i = 0; i > n >> m; og = vector>(n, vector(m)); g = vector>(n, vector(m)); vst = vector>(n, vector(m)); for (int i = 0; i > tmp; for (int j = 0; j > q; q.empla..
https://www.acmicpc.net/problem/1697 #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; int maxs = 100001; vector vst = vector(maxs, false); int cnt = 0; bool fin = false; queue q; q.push(n); vst[n] = true; while(!q.empty()) { int tmp = q.size(); for (int i = 0; i = 0 &..
https://www.acmicpc.net/problem/14940 #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int diri[] = {1, -1, 0, 0}; int dirj[] = {0, 0, 1, -1}; int n, m; cin >> n >> m; vector> g = vector>(n, vector(m)); vector> d = vector>(n, vector(m, 0)); int sa, sb; for (int i = 0; i > g[i][j]; if (g[i][j] == 2) { ..