QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#393909 | #7756. Omniscia Spares None | NATURAL6 | WA | 1ms | 3892kb | C++14 | 1.6kb | 2024-04-19 16:45:20 | 2024-04-19 16:45:20 |
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(1,3));
e.emplace_back(make_pair(1,4));
e.emplace_back(make_pair(2,3));
e.emplace_back(make_pair(2,4));
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: 1ms
memory: 3820kb
input:
3
output:
Yes 1 1 2 2 3 3 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
4
output:
Yes 1 1 2 2 3 3 4 4 0
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
1
output:
Yes 1 1 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
2
output:
Yes 1 1 2 2 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3780kb
input:
8
output:
Yes 1 0 -1 0 0 1 0 -1 10000 10000 -10000 10000 0 8 0 -8 18 1 3 1 4 2 3 2 4 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 Invalid Planar Graph : segments (1, 3) and (4, 5) intersect