QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394483 | #7756. Omniscia Spares None | OccDreamer | WA | 1ms | 3732kb | C++14 | 2.3kb | 2024-04-20 15:12:17 | 2024-04-20 15:12:17 |
Judging History
answer
//OccDreamer
#include<bits/stdc++.h>
#define vc vector
#define db double
#define fi first
#define se second
#define ll long long
#define mk make_pair
#define pb push_back
#define RI register int
#define PI pair<int,int>
#define ull unsigned long long
#define err cerr << " -_- " << endl
#define debug cerr << " ------------------- " << endl
#define input(x) freopen(#x".in","r",stdin)
#define output(x) freopen(#x".out","w",stdout)
#define NO puts("No")
#define YES puts("Yes")
//#define OccDreamer
//#define int long long
using namespace std;
namespace IO{
inline int read(){
int X=0, W=0; char ch=getchar();
while(!isdigit(ch)) W|=ch=='-', ch=getchar();
while(isdigit(ch)) X=(X<<1)+(X<<3)+(ch^48), ch=getchar();
return W?-X:X;
}
inline void write(int x){
if(x<0) x=-x, putchar('-');
if(x>9) write(x/10);
putchar(x%10+'0');
}
inline void sprint(int x){write(x), putchar(32);}
inline void eprint(int x){write(x), putchar(10);}
}using namespace IO;
const int MAXN = 1e5+5;
int n;
int u, d, l, r;
int x[MAXN], y[MAXN], dx, dy;
vc<PI> ans;
signed main(){
n=read();
if(n<=4){
puts("Yes");
for(int i=1;i<=n;++i) sprint(i), eprint(i);
eprint(0);
return 0;
}
if((n&1) || n==6) return puts("No"), 0;
if(n%4==0) dx=1e5, dy=1;
else dx=1, dy=1e5;
x[1]=-dx, x[2]=dx, y[3]=-dy, y[4]=dy, y[6]=2*dy, y[5]=-2*dy;
l=1, r=2; u=5, d=6; ans.pb(mk(1,2)); ans.pb(mk(3,5)); ans.pb(mk(4,6));
ans.pb(mk(1,3)); ans.pb(mk(1,4)); ans.pb(mk(1,6)); ans.pb(mk(1,5));
ans.pb(mk(2,3)); ans.pb(mk(2,4)); ans.pb(mk(2,6)); ans.pb(mk(2,5));
for(int i=6, j=0;i<n;i+=2, j^=1){
if(j==0){
x[i+1]=x[l]-dx, x[i+2]=x[r]+dy;
ans.pb(mk(l,i+1)); ans.pb(mk(i+2,r));
ans.pb(mk(u,i+1)); ans.pb(mk(u,i+2));
ans.pb(mk(d,i+1)); ans.pb(mk(d,i+2));
l=i+1, r=i+2;
}
else{
y[i+1]=x[d]-dx, y[i+2]=x[u]+dy;
ans.pb(mk(d,i+1)); ans.pb(mk(i+2,u));
ans.pb(mk(l,i+1)); ans.pb(mk(l,i+2));
ans.pb(mk(r,i+1)); ans.pb(mk(r,i+2));
d=i+1, u=i+2;
}
}
if(n%4==0) x[n-3]=1e8, x[n-2]=1e8, y[n-3]=-1e9, y[n-2]=1e9;
else x[n-3]=1e9, x[n-2]=1e9, y[n-3]=-1e8, y[n-2]=1e8; ans.pb(mk(n-3,n-2));
puts("Yes");
for(int i=1;i<=n;++i) sprint(x[i]), eprint(y[i]);
eprint(ans.size());
for(auto i:ans) sprint(i.fi), eprint(i.se);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3732kb
input:
3
output:
Yes 1 1 2 2 3 3 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3568kb
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: 3732kb
input:
1
output:
Yes 1 1 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
2
output:
Yes 1 1 2 2 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
8
output:
Yes -100000 0 100000 0 0 -1 0 1 100000000 -1000000000 100000000 1000000000 -200000 0 100001 0 18 1 2 3 5 4 6 1 3 1 4 1 6 1 5 2 3 2 4 2 6 2 5 1 7 8 2 5 7 5 8 6 7 6 8 5 6
result:
ok OK, Accepted.
Test #9:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
9
output:
No
result:
ok OK, Accepted.
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
10
output:
Yes -1 0 1 0 0 -100000 0 100000 0 -200000 0 200000 1000000000 -100000000 1000000000 100000000 0 -1 0 100000 24 1 2 3 5 4 6 1 3 1 4 1 6 1 5 2 3 2 4 2 6 2 5 1 7 8 2 5 7 5 8 6 7 6 8 6 9 10 5 7 9 7 10 8 9 8 10 7 8
result:
FAIL Duplicated Point