QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#84760 | #5528. Least Annoying Constructive Problem | Appleblue17 | WA | 1ms | 3408kb | C++14 | 417b | 2023-03-06 18:23:15 | 2023-03-06 18:24:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=550;
int n;
void add(int x,int y){
x=((x%n)+n)%n,y=(y%n+n)%n;
if(x>y) swap(x,y);
cout<<x+1<<" "<<y+1<<'\n';
}
int main(){
cin>>n;
if(n%2==1){
for(int i=0;i<n;i++){
for(int j=0;j<n/2;j++)
add(i-j,i+1+j);
}
}
else{
for(int i=0;i<n-1;i++){
for(int j=0;j<n/2-1;j++)
add(i-1-j,i+1+j);
add(i,i+n/2);
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3332kb
input:
3
output:
1 2 2 3 1 3
result:
ok Correct
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3408kb
input:
4
output:
2 4 1 3 1 3 2 4 2 4 1 3
result:
wrong answer All edges have to be different