목록전체 글 (191)
정화 코딩
https://www.acmicpc.net/problem/29727 #include using namespace std;long long comb(int n, int r) { if (r > n) return 0; long long ans = 1; for (int i = n; i > n - r; i--) { ans *= i; } for (int i = r; i > 0; i--) { ans /= i; } return ans;}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, xa, ya, xb, yb; cin >> n >> xa >> y..
https://www.acmicpc.net/problem/30645 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int r, c, n; cin >> r >> c >> n; vector d(n); for (int i = 0; i > d[i]; } sort(d.begin(), d.end()); vector maxh(c, 0); int idx = 0; int ans = 0; for (int i = 0; i = n) break; maxh[j] = d[idx++]; ..
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..