# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
404783 | 2021-05-15T02:01:26 Z | tqbfjotld | MalnaRISC (COI21_malnarisc) | C++14 | 1 ms | 332 KB |
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int,int> > > stuff(int n){ if (n==2){ vector<pair<int,int> > t; t.push_back({1,2}); vector<vector<pair<int,int> > >ret; ret.push_back(t); return ret; } vector<vector<pair<int,int> > > ret; auto res = stuff(n/2); for (auto x : res){ vector<pair<int,int> > t; for (auto y : x){ t.push_back({n/2+1-y.first,n/2+1-y.second}); t.push_back({n/2+y.first,n/2+y.second}); } ret.push_back(t); } int t2 = n/2; while (t2>0){ vector<pair<int,int> > t; for (int x = 0; x<n; x++){ if ((x&t2)==0){ t.push_back({x+1,x+t2+1}); } } ret.push_back(t); t2>>=1; } return ret; } int main(){ int n; scanf("%d",&n); int t = 1; while (t<n) t<<=1; auto res = stuff(t); for (auto x : res){ for (auto y : x){ if (y.first>n || y.second>n) continue; printf("CMPSWP R%d R%d ",y.first,y.second); } printf("\n"); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 272 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 332 KB | Expected integer, but "CMPSWP" found |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 332 KB | Expected integer, but "CMPSWP" found |