Submission #1002676

# Submission time Handle Problem Language Result Execution time Memory
1002676 2024-06-19T17:53:06 Z Lobo MalnaRISC (COI21_malnarisc) C++17
10.192 / 100
5 ms 728 KB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back

int main() {
	#ifndef ONLINE_JUDGE
	// freopen("in.in","r",stdin);
	// freopen("out.out","w",stdout);
	#endif

	int n; cin >> n;
	vector<string> lines;
	// for(int i = 0; i < 7; i++) {
	// 	lines.pb("");
	// 	for(int x = 0; x < n; x++) {
	// 		int y = (x^(1<<i));
	// 		if(y > x) continue;
	// 		lines.back() += ("CMPSWP R"+to_string(y+1)+" R"+to_string(x+1)+" ");
	// 	}
	// 	if(lines.back().size() == 0) lines.pop_back();
	// 	else lines.back().pop_back();
	// }

	for(int i = 0; i < n; i++) {
		for(int j = n-2; j >= i; j--) {
			lines.pb(("CMPSWP R"+to_string(j+1)+" R"+to_string(j+2)+" "));
		}
	}

	vector<string> ans = lines;
	// for(int s = 0; s < n; s++) {
	// 	for(int i = s-s; i < s-s+lines.size(); i++) {
	// 		ans.pb(lines[i%(int) lines.size()]);
	// 	}
	// }

	cout << ans.size() << endl;
	for(auto x : ans) {
		cout << x << endl;
	}
}
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 348 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 348 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 2 ms 604 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
# Verdict Execution time Memory Grader output
1 Partially correct 4 ms 604 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 5 ms 728 KB Partially correct