QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#326776#7756. Omniscia Spares NoneDelay_for_five_minutesWA 2ms3944kbC++202.2kb2024-02-14 00:28:582024-02-14 00:28:59

Judging History

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

  • [2024-02-14 00:28:59]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3944kb
  • [2024-02-14 00:28:58]
  • 提交

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) || n == 6) {
        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
    for(int i = 8;i <= n;i += 2) {
        if(cur == 0) {
            ++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);
        adde(i , i - 4);
        adde(i - 1 , i - 5);
        cur ^= 1;
    }
    adde(n - 2 , n - 3) ;
    ///cur = 0 时,y为轴;cur = 1时 x为轴
    int D;
    if(cur == 0) D = 10;
    else D = 2;

    for(int i = 1;i <= cnt;i++) x[i] *= D , y[i] *= D;
    for(int i = 1;i <= cnt;i++) {
        // printf("I %d %d %d\n",i,x[i],y[i]) ;
        if(cur == 0 && x[i] != 0) {
            if(abs(x[i]) == D) {
                y[i] += (D - 1);
            }
            else if(abs(x[i]) == x_range * D) {
                y[i] += y_range*D + 1;
            }
            else {
                y[i] += abs(x[i] / D) * D;
            }
        }
        if(cur == 1 && y[i] != 0) {
            x[i] += (x_range + 1 + abs(y[i]/D) - y_range)*D - 1;
        }
    }
    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: 3788kb

input:

3

output:

Yes
0 1
0 2
0 3
0

result:

ok OK, Accepted.

Test #2:

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

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: 3780kb

input:

1

output:

Yes
0 1
0

result:

ok OK, Accepted.

Test #4:

score: 0
Accepted
time: 2ms
memory: 3884kb

input:

2

output:

Yes
0 1
0 2
0

result:

ok OK, Accepted.

Test #5:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
18
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
6 5

result:

ok OK, Accepted.

Test #9:

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

input:

9

output:

No

result:

ok OK, Accepted.

Test #10:

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

input:

10

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 31
-20 31
0 30
0 -30
24
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
8 7

result:

ok OK, Accepted.

Test #11:

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

input:

11

output:

No

result:

ok OK, Accepted.

Test #12:

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

input:

12

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
30
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
10 9

result:

ok OK, Accepted.

Test #13:

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

input:

13

output:

No

result:

ok OK, Accepted.

Test #14:

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

input:

14

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 41
-30 41
0 40
0 -40
36
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
12 11

result:

ok OK, Accepted.

Test #15:

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

input:

15

output:

No

result:

ok OK, Accepted.

Test #16:

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

input:

16

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
42
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
15 14
15 13
16 14
16 13
16 12
15 11
14 13

result:

ok OK, Accepted.

Test #17:

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

input:

17

output:

No

result:

ok OK, Accepted.

Test #18:

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

input:

18

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 51
-40 51
0 50
0 -50
48
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
15 14
15 13
16 14
16 13
16...

result:

ok OK, Accepted.

Test #19:

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

input:

19

output:

No

result:

ok OK, Accepted.

Test #20:

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

input:

20

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
54
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
15 14
15 13
16 14
16 13
16 12
15 11...

result:

ok OK, Accepted.

Test #21:

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

input:

21

output:

No

result:

ok OK, Accepted.

Test #22:

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

input:

22

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 61
-50 61
0 60
0 -60
60
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
15...

result:

ok OK, Accepted.

Test #23:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

23

output:

No

result:

ok OK, Accepted.

Test #24:

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

input:

24

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
66
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 11
14 10
13 9
15 14
15 13...

result:

ok OK, Accepted.

Test #25:

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

input:

25

output:

No

result:

ok OK, Accepted.

Test #26:

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

input:

26

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 71
-60 71
0 70
0 -70
72
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
1...

result:

ok OK, Accepted.

Test #27:

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

input:

27

output:

No

result:

ok OK, Accepted.

Test #28:

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

input:

28

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
15 14
15 -14
14 0
-14 0
78
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 7
13 12
13 11
14 12
14 1...

result:

ok OK, Accepted.

Test #29:

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

input:

29

output:

No

result:

ok OK, Accepted.

Test #30:

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

input:

30

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 60
-60 60
0 70
0 -70
70 81
-70 81
0 80
0 -80
84
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9...

result:

ok OK, Accepted.

Test #31:

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

input:

31

output:

No

result:

ok OK, Accepted.

Test #32:

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

input:

32

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
15 14
15 -14
14 0
-14 0
17 16
17 -16
16 0
-16 0
90
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10
11 9
12 10
12 9
12 8
11 ...

result:

ok OK, Accepted.

Test #33:

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

input:

33

output:

No

result:

ok OK, Accepted.

Test #34:

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

input:

34

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 60
-60 60
0 70
0 -70
70 70
-70 70
0 80
0 -80
80 91
-80 91
0 90
0 -90
96
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9...

result:

ok OK, Accepted.

Test #35:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

35

output:

No

result:

ok OK, Accepted.

Test #36:

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

input:

36

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
15 14
15 -14
14 0
-14 0
17 16
17 -16
16 0
-16 0
19 18
19 -18
18 0
-18 0
102
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
10 8
10 7
10 6
9 5
11 10...

result:

ok OK, Accepted.

Test #37:

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

input:

37

output:

No

result:

ok OK, Accepted.

Test #38:

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

input:

38

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 60
-60 60
0 70
0 -70
70 70
-70 70
0 80
0 -80
80 80
-80 80
0 90
0 -90
90 101
-90 101
0 100
0 -100
108
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4...

result:

ok OK, Accepted.

Test #39:

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

input:

39

output:

No

result:

ok OK, Accepted.

Test #40:

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

input:

40

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
15 14
15 -14
14 0
-14 0
17 16
17 -16
16 0
-16 0
19 18
19 -18
18 0
-18 0
21 20
21 -20
20 0
-20 0
114
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
8 6
8 5
8 4
7 3
9 8
9 7
...

result:

ok OK, Accepted.

Test #41:

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

input:

41

output:

No

result:

ok OK, Accepted.

Test #42:

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

input:

42

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 60
-60 60
0 70
0 -70
70 70
-70 70
0 80
0 -80
80 80
-80 80
0 90
0 -90
90 90
-90 90
0 100
0 -100
100 111
-100 111
0 110
0 -110
120
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5...

result:

ok OK, Accepted.

Test #43:

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

input:

43

output:

No

result:

ok OK, Accepted.

Test #44:

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

input:

44

output:

Yes
3 2
3 -2
2 0
-2 0
5 4
5 -4
4 0
-4 0
7 6
7 -6
6 0
-6 0
9 8
9 -8
8 0
-8 0
11 10
11 -10
10 0
-10 0
13 12
13 -12
12 0
-12 0
15 14
15 -14
14 0
-14 0
17 16
17 -16
16 0
-16 0
19 18
19 -18
18 0
-18 0
21 20
21 -20
20 0
-20 0
23 22
23 -22
22 0
-22 0
126
1 3
1 4
1 5
2 3
2 4
2 6
3 4
3 5
4 5
3 6
4 6
7 6
7 5
...

result:

ok OK, Accepted.

Test #45:

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

input:

45

output:

No

result:

ok OK, Accepted.

Test #46:

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

input:

46

output:

Yes
0 10
0 -10
10 9
-10 9
0 20
0 -20
20 20
-20 20
0 30
0 -30
30 30
-30 30
0 40
0 -40
40 40
-40 40
0 50
0 -50
50 50
-50 50
0 60
0 -60
60 60
-60 60
0 70
0 -70
70 70
-70 70
0 80
0 -80
80 80
-80 80
0 90
0 -90
90 90
-90 90
0 100
0 -100
100 100
-100 100
0 110
0 -110
110 121
-110 121
0 120
0 -120
132
1 3
1...

result:

wrong answer Invalid Planar Graph : segments (39, 38) and (43, 42) intersect