# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
681708 | 2023-01-13T20:03:17 Z | qwerasdfzxcl | MalnaRISC (COI21_malnarisc) | C++17 | 13 ms | 24276 KB |
#include <bits/stdc++.h> typedef long long ll; using namespace std; int n, cnt; vector<pair<int, int>> ans[1010][1010]; void print(int i, int j){ if (i>n || j>n) return; printf("CMPSWP R%d R%d ", i, j); } void dnc(int l, int r){ if (l==r) return; int m = (l+r)>>1; dnc(l, m); dnc(m+1, r); for (int B=r-l+1;B>=2;B/=2){ int x = r-l+1, y = B; if (ans[x][y].empty()) cnt++; for (int i=l;i<=r;i+=B){ for (int j=1;j<=B/2;j++) ans[x][y].emplace_back(i+j-1, i+B-j); } } } int main(){ scanf("%d", &n); int t = 1; while(t < n) t *= 2; dnc(1, t); printf("%d\n", cnt); for (int i=2;i<=t;i*=2){ for (int j=i;j>=2;j/=2){ for (auto &[x, y]:ans[i][j]) print(x, y); printf("\n"); } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 24148 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 24160 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24264 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24252 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 24276 KB | not sorted |
2 | Halted | 0 ms | 0 KB | - |