QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#84426 | #5528. Least Annoying Constructive Problem | CharlieVinnie | WA | 0ms | 3312kb | C++14 | 578b | 2023-03-06 14:53:26 | 2023-03-06 14:53:29 |
Judging History
answer
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rev(i,a,b) for(int i=a;i>=b;i--)
#define Fin(file) freopen(file,"r",stdin)
#define Fout(file) freopen(file,"w",stdout)
using namespace std; using ll = long long;
const int N=505;
int n;
void Solve1(){
For(i,0,n-1){
For(j,1,n/2) cout<<1+(i-j+n)%n<<' '<<1+(i+j)%n<<'\n';
}
}
void Solve2(){
For(i,0,n-2){
For(j,1,n/2-1) cout<<1+(i-j+n-1)%(n-1)<<' '<<1+(i+j)%(n-1)<<'\n';
cout<<1+i<<' '<<1+n-1<<'\n';
}
}
int main(){
cin>>n; if(n%2==1) Solve1(); else Solve2();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3312kb
input:
3
output:
3 2 1 3 2 1
result:
wrong answer Integer 2 violates the range [4, 3]