Submission #420612

# Submission time Handle Problem Language Result Execution time Memory
420612 2021-06-08T12:57:51 Z MetalPower MalnaRISC (COI21_malnarisc) C++14
76.4122 / 100
2 ms 332 KB
#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 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 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