QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#393901 | #7756. Omniscia Spares None | NATURAL6 | WA | 0ms | 3864kb | C++14 | 1.4kb | 2024-04-19 16:41:02 | 2024-04-19 16:41:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int qread()
{
int a=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)){(a*=10)+=(ch^48);ch=getchar();}
return a*f;
}
int n;
vector< pair<int,int> >e;
int main()
{
n=qread();
if(n<=4)
{
puts("Yes");
for(int i=1;i<=n;++i)printf("%d %d\n",i,i);
printf("%d",0);
return 0;
}
if(n<=6||n&1)return puts("No"),0;
puts("Yes");
printf("1 0\n-1 0\n0 1\n0 -1\n");
e.emplace_back(make_pair(3,4));
for(int i=6;i<=n;i+=2)
{
if(i%4==2)
{
if(i==n-2)printf("10000 10000\n-10000 10000\n");
else printf("%d %d\n%d %d\n",i,0,-i,0);
for(int j=i-5;j<=i-2;++j)
{
if((j&3)^2)e.emplace_back(make_pair(j,i-1));
if((j&3)^1)e.emplace_back(make_pair(j,i));
}
}
else
{
if(i==n-2)printf("10000 10000\n10000 -10000\n");
else printf("%d %d\n%d %d\n",0,i,0,-i);
for(int j=i-5;j<=i-2;++j)
{
if((j&3)^0)e.emplace_back(make_pair(j,i-1));
if((j&3)^3)e.emplace_back(make_pair(j,i));
}
}
}
e.emplace_back(make_pair(n-2,n-3));
for(pair<int,int>i:e)printf("%d %d\n",i.first,i.second);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3772kb
input:
3
output:
Yes 1 1 2 2 3 3 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
4
output:
Yes 1 1 2 2 3 3 4 4 0
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
1
output:
Yes 1 1 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
2
output:
Yes 1 1 2 2 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3788kb
input:
8
output:
Yes 1 0 -1 0 0 1 0 -1 10000 10000 -10000 10000 0 8 0 -8 3 4 1 5 2 6 3 5 3 6 4 5 4 6 3 7 4 8 5 7 5 8 6 7 6 8 6 5
result:
wrong answer More than 4 Points' Degrees are Less than 6