Submission #414544

# Submission time Handle Problem Language Result Execution time Memory
414544 2021-05-30T15:53:07 Z medmdg MalnaRISC (COI21_malnarisc) C++14
0 / 100
2 ms 548 KB
#include <bits/stdc++.h>
#define ll  long long
#define endl    "\n"
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;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=1;i<n/2;i++){
        for(int j=n/2;j<=n;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:26: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]
   26 |     for(int i=0;i<ans.size();i++){
      |                 ~^~~~~~~~~~~
malnarisc.cpp:19:8: warning: unused variable 'k' [-Wunused-variable]
   19 |     ll k=ans.size();
      |        ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Integer parameter [name=t] equals to 31, violates the range [1, 28]
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Integer parameter [name=t] equals to 83, violates the range [1, 78]
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Integer parameter [name=t] equals to 127, violates the range [1, 120]
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Integer parameter [name=t] equals to 511, violates the range [1, 496]
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 292 KB Integer parameter [name=t] equals to 1403, violates the range [1, 1378]
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB Integer parameter [name=t] equals to 2047, violates the range [1, 2016]
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB Integer parameter [name=t] equals to 2663, violates the range [1, 2628]
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 460 KB Integer parameter [name=t] equals to 3361, violates the range [1, 3321]
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 548 KB Integer parameter [name=t] equals to 4139, violates the range [1, 4095]
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 544 KB Integer parameter [name=t] equals to 4999, violates the range [1, 4950]