# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420685 | 2021-06-08T13:18:33 Z | Pyqe | MalnaRISC (COI21_malnarisc) | C++14 | 1 ms | 292 KB |
#include <bits/stdc++.h> using namespace std; long long n,nn; bool bad; void ad(long long x,long long w) { if(x+(1ll<<w)<n) { if(bad) { printf(" "); } printf("CMPSWP R%lld R%lld",x+1,x+(1ll<<w)+1); bad=1; } } int main() { long long i,j,r,c=0; scanf("%lld",&n); for(nn=1;nn<n;nn*=2,c++); printf("%lld\n",c*(c+1)/2); for(i=1;1ll<<i<=nn;i++) { bad=0; for(j=0;j<nn;j++) { if(!(j>>i-1&1)) { ad(j,i-1); } } printf("\n"); for(j=i-2;j+1;j--) { bad=0; for(r=0;r<nn;r++) { if(!((r^r+(1ll<<j))>>i&1)&&(r>>j&1)) { ad(r,j); } } printf("\n"); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 292 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 288 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |