Submission #1003599

# Submission time Handle Problem Language Result Execution time Memory
1003599 2024-06-20T13:47:24 Z Lalic MalnaRISC (COI21_malnarisc) C++17
30.5868 / 100
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<double> cd;

const int MAXN = 1e5+10;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);

void solve(){
	int n; cin >> n;
	
	if(!(n&1)){
		cout << n-1 << "\n";
		for(int i=0;i<n;i++)
			for(int j=((i&1) ? 2 : 1);j+1<=n;j+=2)
				cout << "CMPSWP R" << j << " R" << j+1 << " \n"[j+1==n || j+1==n-1];
		return;
	}
	
	cout << n << "\n";
	for(int i=0;i<n;i++)
		for(int j=((i&1) ? 2 : 1);j+1<=n;j+=2)
			cout << "CMPSWP R" << j << " R" << j+1 << " \n"[j+1==n || j+1==n-1];
}

int32_t main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	
	int tt=1;
	//~ cin >> tt;
	while(tt--) solve();
	return 0;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 348 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Extra information in the output file
2 Halted 0 ms 0 KB -