QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#326764#7756. Omniscia Spares NoneDelay_for_five_minutesWA 0ms3880kbC++201.9kb2024-02-13 23:48:452024-02-13 23:48:46

Judging History

你现在查看的是最新测评结果

  • [2024-02-13 23:48:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3880kb
  • [2024-02-13 23:48:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int x[105] , y[105];
int cnt = 0;
void addp(int a,int b) {
    x[++cnt] = a;
    y[cnt] = b;
    return ;
}
typedef pair<int,int> pii;
vector<pii> Ed;
void adde(int u,int v) {
    Ed.push_back({u , v});
}
int main() {
    int n ; cin >> n;
    if(n <= 4) {
        printf("Yes\n");
        for(int i = 1;i <= n;i++) printf("0 %d\n",i) ;
        printf("0\n") ; return 0;
    }
    if(n & 1) {
        printf("No\n") ; return 0;
    }
    addp(0 , 1);
    addp(0 , -1);
    addp(1 , 0);
    addp(-1 , 0);
    addp(0 , 2);
    addp(0 , -2) ;
    adde(1 , 3) ; adde(1 , 4) ; adde(1 , 5) ; adde(2 , 3) ; adde(2 , 4) ; adde(2 , 6);
    adde(3 , 4) ;
    adde(3 , 5) ; adde(4 , 5) ; adde(3 , 6) ; adde(4 , 6) ;
    int x_range = 1 , y_range = 2;
    int cur = 0 ; ///0 , add to x , 1 , add to y
    if(n == 6) {
        adde(5 , 6);
        cur ^= 1;
    }
    for(int i = 8;i <= n;i += 2) {
        if(cur) {
            ++x_range;
            addp(x_range , 0);
            addp(-x_range , 0);
        }
        else {
            ++y_range;
            addp(0 , y_range);
            addp(0 , -y_range);
        }
        adde(i - 1 , i - 2);
        adde(i - 1 , i - 3);
        adde(i , i - 2);
        adde(i , i - 3);
        if(i <= n - 2) {
            adde(i , i - 4);
            adde(i - 1 , i - 5);
        }
        else {
            adde(i - 3 , i - 4) ;
        }
        cur ^= 1;
    }
    ///cur = 0 时,y为轴;cur = 1时 x为轴
    for(int i = 1;i <= cnt;i++) {
        if(cur == 0 && x[i] != 0) {
            y[i] += (y_range + 1 + x[i] - x_range);
        }
        if(cur == 1 && y[i] != 0) {
            x[i] += (x_range + 1 + y[i] - y_range);
        }
    }
    printf("Yes\n") ;
    for(int i = 1;i <= cnt;i++) printf("%d %d\n",x[i],y[i]) ;
    printf("%d\n",Ed.size()) ;
    for(auto [u,v] : Ed) printf("%d %d\n",u,v);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3880kb

input:

3

output:

Yes
0 1
0 2
0 3
0

result:

ok OK, Accepted.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

4

output:

Yes
0 1
0 2
0 3
0 4
0

result:

ok OK, Accepted.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

1

output:

Yes
0 1
0

result:

ok OK, Accepted.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

2

output:

Yes
0 1
0 2
0

result:

ok OK, Accepted.

Test #5:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3820kb

input:

6

output:

Yes
1 1
-1 -1
1 0
-1 0
2 2
-2 -2
12
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
5 6

result:

wrong answer Wrong Verdict.