Submission #486849

#TimeUsernameProblemLanguageResultExecution timeMemory
486849ETKMalnaRISC (COI21_malnarisc)C++14
100 / 100
1 ms296 KiB
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define fi first #define se second using namespace std; int n; int main(){ cin>>n; int ans=0; for(int p=1;p<n;p<<=1){ ans++; } ans=ans*(ans+1)/2; cout<<ans<<"\n"; for(int p=1;p<n;p<<=1){ for(int k=p;k;k>>=1){ for(int j=k%p;j<=n-k-1;j+=2*k){ rep(i,0,min(k-1,n-j-k-1)){ if((i+j)/(2*p)==(i+j+k)/(2*p)) cout<<"CMPSWP R"<<i+j+1<<" R"<<i+j+k+1<<" "; } } puts(""); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...