QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#290910 | #7756. Omniscia Spares None | PhantomThreshold | WA | 1ms | 3780kb | C++20 | 1.4kb | 2023-12-25 20:16:04 | 2023-12-25 20:16:05 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n<=4)
{
cout<<"Yes"<<endl;
for(int i=1;i<=n;i++)
cout<<i<<' '<<0<<endl;
cout<<0<<endl;
}
else if(n<=6 or n%2==1)
{
cout<<"No"<<endl;
}
else
{
cout<<"Yes"<<endl;
vector<pair<int,int>> p(n+5),edges;
p[1]={1,0};p[2]={-1,0};
p[3]={0,1};p[4]={0,-1};
edges.emplace_back(3,4);
edges.emplace_back(1,3);
edges.emplace_back(1,4);
edges.emplace_back(2,3);
edges.emplace_back(2,4);
for(int i=6;i<=n;i+=2)
{
if(i%4==2)
{
if(i!=n)
{
p[i-1]={i/4+1,0};
p[i]={-i/4-1,0};
}
else
{
p[i-1]={1000000000,1000};
p[i]={-1000000000,1000};
}
for(int j=i-5;j<=i-2;j++)
{
if(j%4!=2)
edges.emplace_back(j,i-1);
if(j%4!=1)
edges.emplace_back(j,i);
}
}
else
{
if(i!=n)
{
p[i-1]={0,i/4};
p[i]={0,-i/4};
}
else
{
p[i-1]={1000,100000000};
p[i]={1000,-100000000};
}
for(int j=i-5;j<=i-2;j++)
{
if(j%4!=0)
edges.emplace_back(j,i-1);
if(j%4!=3)
edges.emplace_back(j,i);
}
}
}
edges.emplace_back(n-1,n);
for(int i=1;i<=n;i++)
cout<<p[i].first<<' '<<p[i].second<<endl;
cout<<edges.size()<<endl;
for(auto [u,v]:edges)
cout<<u<<' '<<v<<endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
3
output:
Yes 1 0 2 0 3 0 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
4
output:
Yes 1 0 2 0 3 0 4 0 0
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
1
output:
Yes 1 0 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
2
output:
Yes 1 0 2 0 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3488kb
input:
8
output:
Yes 1 0 -1 0 0 1 0 -1 2 0 -2 0 1000 100000000 1000 -100000000 18 3 4 1 3 1 4 2 3 2 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 7 8
result:
wrong answer More than 4 Points' Degrees are Less than 6