QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#346867 | #5528. Least Annoying Constructive Problem | ucup-team134 | WA | 0ms | 3848kb | C++17 | 424b | 2024-03-09 03:26:45 | 2024-03-09 03:26:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int m;
int add(int a,int b){
a+=b;
a%=m;
if(a<0)a+=m;
if(a==0)a=m;
return a;
}
void Edge(int u,int v){
if(u>v)swap(u,v);
printf("%i %i\n",u,v);
}
int main(){
int n;
scanf("%i",&n);
m=n%2==1?n:n-1;
for(int i=1;i<=m;i++){
for(int j=0;j<m/2;j++){
Edge(add(i,-j),add(i,j+1));
}
if(n%2==0){
Edge(add(i,-1),n);
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3752kb
input:
3
output:
1 2 2 3 1 3
result:
ok Correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
4
output:
1 2 3 4 2 3 1 4 1 3 2 4
result:
ok Correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
5
output:
1 2 3 5 2 3 1 4 3 4 2 5 4 5 1 3 1 5 2 4
result:
ok Correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
6
output:
1 2 3 5 5 6 2 3 1 4 1 6 3 4 2 5 2 6 4 5 1 3 3 6 1 5 2 4 4 6
result:
ok Correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
7
output:
1 2 3 7 4 6 2 3 1 4 5 7 3 4 2 5 1 6 4 5 3 6 2 7 5 6 4 7 1 3 6 7 1 5 2 4 1 7 2 6 3 5
result:
ok Correct
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3840kb
input:
8
output:
1 2 3 7 4 6 7 8 2 3 1 4 5 7 1 8 3 4 2 5 1 6 2 8 4 5 3 6 2 7 3 8 5 6 4 7 1 3 4 8 6 7 1 5 2 4 5 8 1 7 2 6 3 5 6 8
result:
wrong answer Every consecutive n-1 edges have to form a tree, false for 3