# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1002905 | gabistroeh | MalnaRISC (COI21_malnarisc) | C++14 | 3 ms | 5468 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int mark[2010][2010];
vector <pair<int, int> > comandos[200010];
int N;
bool check(){
for(int i=1; i<=N; i++){
for(int j=i+1; j<=N; j++){
if(mark[i][j]==0) return 0;
}
}
return 1;
}
int main(){
cin >> N;
int resp = 0;
while(!check()){
resp++;
int usado[N+1];
for(int i=1; i<=N; i++) usado[i] = 0;
for(int i=1; i<=N; i++){
for(int j=i+1; j<=N; j++){
if(usado[i]==1) break;
if(mark[i][j]==0 && usado[j]==0){
mark[i][j] = 1;
comandos[resp].push_back({i, j});
usado[i] = 1;
usado[j] = 1;
}
}
}
}
cout << resp << endl;
for(int i=1; i<=resp; i++){
for(int j=0; j<comandos[i].size(); j++){
cout << "CMPSWP R" << comandos[i][j].first << " R" << comandos[i][j].second << " ";
}
cout << endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |