QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#406858 | #5528. Least Annoying Constructive Problem | Jryno1 | WA | 1ms | 3592kb | C++14 | 749b | 2024-05-07 19:22:28 | 2024-05-07 19:22:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
cin>>n;
if(n&1){
for(int i=0;i<n;i++){
int r=(i-1+n)%n,l=(i+1)%n;
for(int j=1;j<=n/2;j++){
cout<<l+1<<" "<<r+1<<"\n";
l++,l%=n;
r+=n-1,r%=n;
}
}
} else {
for(int i=1;i<n;i++){
int r=(i-1+n)%n,l=(i+1)%n;
cout<<1<<" "<<i+1<<"\n";
if(!r)r=n-1;
if(!l)l=1;
for(int j=1;j<n/2;j++){
cout<<l+1<<" "<<r+1<<"\n";
l++,l%=n;
r+=n-1,r%=n;
if(!r)r=n-1;
if(!l)l=1;
}
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3592kb
input:
3
output:
2 3 3 1 1 2
result:
wrong answer Integer 1 violates the range [4, 3]