QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84397#5528. Least Annoying Constructive Problemshr_WA 2ms3500kbC++17542b2023-03-06 14:33:462023-03-06 14:34:20

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-06 14:34:20]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3500kb
  • [2023-03-06 14:33:46]
  • 提交

answer

# include <bits/stdc++.h>
using namespace std;
int n;
int turn_(int x) { return (x-1)%n+1;}
int main() {
//    freopen("in.in","r",stdin);
//    freopen("out.out","w",stdout);

    scanf("%d",&n);

    int m=n; 
    if (n%2==0) n--;
    vector<pair<int,int> > ans;
    for (int i=1;i<=n;i++) {
        if (n!=m) ans.push_back(pair<int,int> (i,n+1));
        for (int j=1;j<=n/2;j++) ans.push_back(pair<int,int> (turn_(i+j),turn_(i+n-j)));
    }

    for (auto o : ans) printf("%d %d\n",o.first,o.second);

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3500kb

input:

3

output:

2 3
3 1
1 2

result:

wrong answer Integer 1 violates the range [4, 3]