QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#393904 | #7756. Omniscia Spares None | NATURAL6 | WA | 0ms | 3904kb | C++14 | 1.4kb | 2024-04-19 16:43:20 | 2024-04-19 16:43:21 |
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));
printf("%d\n",(int)e.size());
for(pair<int,int>i:e)printf("%d %d\n",i.first,i.second);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3864kb
input:
3
output:
Yes 1 1 2 2 3 3 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3788kb
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: 3852kb
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: 3660kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3904kb
input:
8
output:
Yes 1 0 -1 0 0 1 0 -1 10000 10000 -10000 10000 0 8 0 -8 14 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