QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394021 | #7756. Omniscia Spares None | Xun_xiaoyao | WA | 1ms | 3952kb | C++14 | 1.9kb | 2024-04-19 20:58:28 | 2024-04-19 20:58:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
cin>>n;
if(n<=4)
{
printf("Yes\n");
for(int i=1;i<=n;i++)
printf("%d 0\n",i);
printf("0\n");
return 0;
}
if(n==6||n%2==1) return printf("No\n"),0;
if(n%4==0)
{
for(int i=1;i<=n;i+=4)
{
if(i+4>n)
{
printf("0 %d\n",i);
printf("0 -%d\n",i);
printf("1000000000 1000\n");
printf("-1000000000 1000\n");
}
else
{
printf("0 %d\n",i);
printf("0 -%d\n",i);
printf("%d 0\n",i);
printf("-%d 0\n",i);
}
}
printf("%d\n",3*n-6);
printf("1 2\n");
printf("%d %d\n",n-1,n);
for(int i=5;i<=n;i++) printf("%d %d\n",i,i-4);
for(int i=1;i<=n;i+=4)
{
printf("%d %d\n", i ,i+2);
printf("%d %d\n", i ,i+3);
printf("%d %d\n",i+1,i+2);
printf("%d %d\n",i+1,i+3);
if(i!=1)
{
printf("%d %d\n",i-3,i+2);
printf("%d %d\n",i-3,i+3);
printf("%d %d\n",i-4,i+2);
printf("%d %d\n",i-4,i+3);
}
}
}
else
{
n-=2;
for(int i=1;i<=n;i+=4)
{
if(i+4>n)
{
printf("1000 1000000000\n");
printf("1000 -1000000000\n");
printf("%d 0\n",i);
printf("-%d 0\n",i);
}
else
{
printf("0 %d\n",i);
printf("0 -%d\n",i);
printf("%d 0\n",i);
printf("-%d 0\n",i);
}
}
printf("%d 0\n",n+1);
printf("-%d 0\n",n+1);
printf("%d\n",3*n);
printf("1 2\n");
printf("%d %d\n",n-3,n-2);
for(int i=5;i<=n;i++) printf("%d %d\n",i,i-4);
for(int i=1;i<=n;i+=4)
{
printf("%d %d\n", i ,i+2);
printf("%d %d\n", i ,i+3);
printf("%d %d\n",i+1,i+2);
printf("%d %d\n",i+1,i+3);
if(i!=1)
{
printf("%d %d\n",i-3,i+2);
printf("%d %d\n",i-3,i+3);
printf("%d %d\n",i-4,i+2);
printf("%d %d\n",i-4,i+3);
}
}
printf("%d %d\n",n-3,n+1);
printf("%d %d\n",n-3,n+2);
printf("%d %d\n",n-2,n+1);
printf("%d %d\n",n-2,n+2);
printf("%d %d\n",n-1,n+1);
printf("%d %d\n", n ,n+2);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3952kb
input:
3
output:
Yes 1 0 2 0 3 0 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3844kb
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: 3780kb
input:
2
output:
Yes 1 0 2 0 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3760kb
input:
8
output:
0 1 0 -1 1 0 -1 0 0 5 0 -5 1000000000 1000 -1000000000 1000 18 1 2 7 8 5 1 6 2 7 3 8 4 1 3 1 4 2 3 2 4 5 7 5 8 6 7 6 8 2 7 2 8 1 7 1 8
result:
wrong answer Token parameter [name=verdict] equals to "0", doesn't correspond to pattern "Yes|No"