#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
void print(int a, int b){
cout << "CMPSWP ";
cout << "R" << a << " ";
cout << "R" << b << " ";
}
int main(){
int n; cin >> n;
cout << (n*n-n)/2 << '\n';
set<pii> pares;
for(int i=1; i<=n; i++){
for(int j=i+1; j<=n; j++){
pares.insert({i,j});
}
}
while(pares.size()){
vector<bool> mark(n+1);
vector<pii> arr;
for(auto[a,b] : pares){
if(!mark[a] && !mark[b]){
mark[a]=mark[b]=true;
arr.pb({a,b});
}
}
for(auto[a,b] : arr) print(a,b);
cout << '\n';
for(auto ab : arr) pares.erase(ab);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
600 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
600 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
600 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |