Submission #420612

#TimeUsernameProblemLanguageResultExecution timeMemory
420612MetalPowerMalnaRISC (COI21_malnarisc)C++14
76.41 / 100
2 ms332 KiB
#include <bits/stdc++.h> using namespace std; int N; string s = "CMPSWP"; #define pii pair<int, int> #define fi first #define se second #define mp make_pair vector<vector<pii>> v; void solve(){ cout << v.size() << '\n'; for(auto& a : v){ int n = a.size(); for(int i = 0; i < n; i++){ cout << s << " R" << a[i].fi << " R" << a[i].se << (i == n - 1 ? '\n' : ' '); } } } int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin >> N; for(int i = 1; i <= N; i++){ v.push_back({}); if(i & 1){ for(int j = 1; j < N; j += 2) v.back().push_back(mp(j, j + 1)); }else{ for(int j = 2; j < N; j += 2) v.back().push_back(mp(j, j + 1)); } if(v.back().empty()) v.pop_back(); } solve(); }
#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...