QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#399942 | #7756. Omniscia Spares None | dongyc666 | WA | 0ms | 3836kb | C++17 | 1011b | 2024-04-26 20:03:07 | 2024-04-26 20:03:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int NR=1000;
int n,tot,u[NR],v[NR],cnt,x[NR],y[NR];
void addp(int v1,int v2){
cnt++;x[cnt]=v1;y[cnt]=v2;
}
void adde(int x,int y){
tot++;
u[tot]=x;v[tot]=y;
}
int main(){
cin>>n;
if(n<=4){
puts("Yes");
for(int i=1;i<=n;i++)printf("%d %d\n",i,0);
cout<<0<<endl;
return 0;
}
if(n<=6||(n&1)){
puts("No");
return 0;
}
addp(0,-1);addp(0,1);addp(-1,0);addp(1,0);
adde(3,4);adde(1,3);adde(2,3);adde(1,4);adde(2,4);
for(int i=6;i<=n;i+=2){
int x=(i+2)/4;
if(i%4==2){
addp(0,-x);addp(0,x);
}
else{
addp(-x,0);addp(x,0);
}
for(int x=i-3;x<=i-2;x++)
for(int y=i-1;y<=i;y++)adde(x,y);
adde(i-4,i);adde(i-5,i-1);
}
if(n&2){
for(int i=1;i<=n-2;i++)x[i]+=100;
}
else{
for(int i=1;i<=n-2;i++)y[i]+=100;
}
adde(n,n-1);
puts("Yes");
for(int i=1;i<=n;i++)cout<<x[i]<<' '<<y[i]<<endl;
cout<<tot<<endl;
for(int i=1;i<=tot;i++)cout<<u[i]<<' '<<v[i]<<endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3756kb
input:
3
output:
Yes 1 0 2 0 3 0 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
4
output:
Yes 1 0 2 0 3 0 4 0 0
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
1
output:
Yes 1 0 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2
output:
Yes 1 0 2 0 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3588kb
input:
8
output:
Yes 0 99 0 101 -1 100 1 100 0 98 0 102 -2 0 2 0 18 3 4 1 3 2 3 1 4 2 4 3 5 3 6 4 5 4 6 2 6 1 5 5 7 5 8 6 7 6 8 4 8 3 7 8 7
result:
wrong answer More than 4 Points' Degrees are Less than 6