QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#84483#5528. Least Annoying Constructive ProblemPdw2007WA 0ms3476kbC++14717b2023-03-06 15:21:032023-03-06 15:21:07

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 15:21:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3476kb
  • [2023-03-06 15:21:03]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n;
void calc(int x,int y) {
    x=(x+n)%n,y=(y+n)%n;
    if(x>y) swap(x,y);
    printf("%d %d\n",x,y);
    return;
}
namespace sub0{
    void koishi() {
        for(int i=1;i<n;i++) {
            printf("%d %d\n",i,n);
            for(int j=0;j<(n/2)-1;j++) {
                calc(i-j,i+1+j);
            }
        }
        return;
    }
}
namespace sub1{
    void koishi() {
        for(int i=1;i<=n;i++) {
            for(int j=0;j<(n/2);j++) {
                calc(i-j,i+1+j);
            }
        }
        return;
    }
}
int main() {
    scanf("%d",&n);
    if(n%2==0) sub0::koishi();
    else sub1::koishi();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3476kb

input:

3

output:

1 2
0 2
0 1

result:

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