Submission #414581

# Submission time Handle Problem Language Result Execution time Memory
414581 2021-05-30T16:58:08 Z aymanrs MalnaRISC (COI21_malnarisc) C++14
68.455 / 100
2 ms 332 KB
#include <bits/stdc++.h>
using namespace std;
void solve(){
    int n;
	cin >> n;
	if(n == 1){
		cout << "0\n";
		return;
	}
	bool f = true;
	cout << n + 3 << '\n';
	for(int i = 0;i < n+3;i++){
		if(f) {
			for(int j = 0;j+1 < n;j += 2){
				cout << "CMPSWP R" << j+1 << " R" << j+2  << ' ';
			}
			cout << '\n';
		} else {
			for(int j = 1;j+1 < n;j += 2){
				cout << "CMPSWP R" << j+1 << " R" << j+2  << ' ';
			}
			if(n > 2) cout << '\n';
		}
		f = !f;
	}
}
int main(){	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
	//cin >> t;
	while(t--) solve();
}
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 308 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 256 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 332 KB Partially correct