Submission #414549

# Submission time Handle Problem Language Result Execution time Memory
414549 2021-05-30T16:03:26 Z medmdg MalnaRISC (COI21_malnarisc) C++14
0 / 100
12 ms 580 KB
#include <bits/stdc++.h>
#define ll  long long
using namespace std;
int main() {
    ll n;
    cin>>n;
    vector<pair<ll,ll> >  ans;
    for(int i=1;i<=n/2;i++){
        for(int j=i+1;j<=n/2;j++){
            ans.push_back(make_pair(i,j));
        }
    }
    for(int i=n/2+1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            ans.push_back(make_pair(i,j));
        }
    }
    ll k=ans.size();
    for(int i=n/2+1;i<=n;i++){
        for(int j=1;j<=n/2;j++){
            ans.push_back(make_pair(i,j));
        }
    }
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++){
        cout<<"CMPSWP R"<<ans[i].first<<" R"<<ans[i].second<<endl;
    }
}

Compilation message

malnarisc.cpp: In function 'int main()':
malnarisc.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i=0;i<ans.size();i++){
      |                 ~^~~~~~~~~~~
malnarisc.cpp:18:8: warning: unused variable 'k' [-Wunused-variable]
   18 |     ll k=ans.size();
      |        ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 388 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 332 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 332 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB not sorted
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 580 KB not sorted