Submission #1002866

# Submission time Handle Problem Language Result Execution time Memory
1002866 2024-06-19T20:54:40 Z Juan MalnaRISC (COI21_malnarisc) C++17
22.8441 / 100
4 ms 604 KB
#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;

	int magic=n*(int)sqrt(n)/2;
	cout << magic << '\n';
	for(int i=1; i<=magic; i++){
		for(int j=1+(i%2); j<n; j+=2){
			print(j,j+1);
		}
		cout << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 3 ms 600 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 3 ms 604 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 4 ms 604 KB Partially correct