Submission #1116127

# Submission time Handle Problem Language Result Execution time Memory
1116127 2024-11-21T09:25:17 Z epicci23 MalnaRISC (COI21_malnarisc) C++17
0 / 100
1 ms 504 KB
#include "bits/stdc++.h"
#define int long long
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
using namespace std;

void _(){
  int n;
  cin >> n;
  
  vector<string> v;

  for(int i=1;i<=n/2+1;i++){
  	int p = 2;
  	if(i&1) p = 1;
    int ok = 0;

    string s = "";

    while(p<n){
      if(ok) s.push_back(' ');
      s+="CMPSWP ";
      s.push_back('R');
      s+=to_string(p);
      s.push_back(' ');
      s.push_back('R');
      s+=to_string(p+1);
      p+=2;
      ok=1;
    }
    if(ok) v.push_back(s);
  }

  cout << sz(v) << '\n';
  for(string u : v) cout << u << '\n';
}

int32_t main(){
  cin.tie(0); ios::sync_with_stdio(0);
  int tc=1;//cin >> tc;
  while(tc--) _();
  return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 504 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB not sorted
2 Halted 0 ms 0 KB -