Submission #1002971

#TimeUsernameProblemLanguageResultExecution timeMemory
1002971SofiatpcMalnaRISC (COI21_malnarisc)C++14
10.43 / 100
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define sc second #define sz(v) (int)v.size() typedef pair<int,int> pii; vector< pair<pii,pii>> v; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; for(int i = 1; i <= n; i++){ int r = n-i, x = i+1; if(r%2 == 0){ if(x > n)continue; //cout<<i<<" "<<x<<" caso1\n"; v.push_back({ {i,x}, {-1,-1} }); x++; if(x == n){ //cout<<i<<" "<<x<<" caso2\n"; v.push_back({ {i,x}, {-1,-1} }); continue; } if(x > n)continue; //cout<<i<<" "<<x<<" caso3\n"; v.push_back({ {i,x}, {x+1,x+2} }); x++; }else{ if(x == n){ //cout<<i<<" "<<x<<" caso5\n"; v.push_back({ {i,x}, {-1,-1} }); continue; } if(x > n)continue; //cout<<i<<" "<<x<<" caso4\n"; v.push_back({ {i,x}, {x+1,x+2} }); x++; } for(int j = x; j <= n; j+=2){ if(j+2 > n)v.push_back({ {i,j}, {-1,-1} }); else v.push_back({ {i,j}, {j+2,j+3} }); } } cout<<sz(v)<<"\n"; for(int i = 0; i < sz(v); i++){ cout<<"CMPSWP R"<<v[i].fi.fi<<" R"<<v[i].fi.sc; if(v[i].sc.fi != -1)cout<<" CMPSWP R"<<v[i].sc.fi<<" R"<<v[i].sc.sc; cout<<"\n"; } }
#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...