QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#325783#4902. 聚会DaiRuiChen00745.454545 156ms7796kbC++171.1kb2024-02-11 22:46:432024-02-11 22:46:44

Judging History

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

  • [2024-02-11 22:46:44]
  • 评测
  • 测评结果:45.454545
  • 用时:156ms
  • 内存:7796kb
  • [2024-02-11 22:46:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int a[1005][1005],id[1005][3];
signed main() {
	int n;
	scanf("%d",&n);
	if(n%6==3) {
		int m=n/3;
		for(int i=0,t=0;i<m;++i) {
			for(int j:{0,1,2}) id[i][j]=++t;
			printf("%d %d %d\n",id[i][0],id[i][1],id[i][2]);
		}
		for(int i=0;i<m;++i) {
			for(int x=i,y=i,j=0;j<m;++j) {
				a[x][y]=i,x=(x+1)%m,y=(y+m-1)%m;
			}
		}
		for(int i=0;i<m;++i) for(int j=i+1;j<m;++j) for(int k:{0,1,2}) {
			printf("%d %d %d\n",id[i][k],id[j][k],id[a[i][j]][(k+1)%3]);
		}
	} else {
		int m=(n-1)/3;
		for(int i=0,t=0;i<m;++i) {
			for(int j:{0,1,2}) id[i][j]=++t;
			printf("%d %d %d\n",id[i][0],id[i][1],id[i][2]);
		}
		for(int i=0;i<m/2;++i) {
			for(int x=i,y=i,j=0;j<m;++j) {
				a[x][y]=i,x=(x+1)%m,y=(y+m-1)%m;
			}
			for(int x=i+1,y=i,j=0;j<m;++j) {
				a[x][y]=i+m/2,x=(x+1)%m,y=(y+m-1)%m;
			}
		}
		for(int i=0;i<m/2;++i) for(int k:{0,1,2}) {
			printf("%d %d %d\n",n,id[i+m/2][k],id[i][(k+1)%3]);
		}
		for(int i=0;i<m;++i) for(int j=i+1;j<m;++j) for(int k:{0,1,2}) {
			printf("%d %d %d\n",id[i][k],id[j][k],id[a[i][j]][(k+1)%3]);
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 9.09091
Accepted
time: 0ms
memory: 3780kb

input:

1

output:


result:

ok accepted

Test #2:

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

input:

3

output:

1 2 3

result:

ok accepted

Test #3:

score: -9.09091
Wrong Answer
time: 0ms
memory: 3872kb

input:

7

output:

1 2 3
4 5 6
7 4 2
7 5 3
7 6 1
1 4 5
2 5 6
3 6 4

result:

wrong answer wrong construction

Subtask #2:

score: 9.09091
Accepted

Test #12:

score: 9.09091
Accepted
time: 0ms
memory: 3776kb

input:

3

output:

1 2 3

result:

ok accepted

Test #13:

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

input:

9

output:

1 2 3
4 5 6
7 8 9
1 4 8
2 5 9
3 6 7
1 7 5
2 8 6
3 9 4
4 7 2
5 8 3
6 9 1

result:

ok accepted

Test #14:

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

input:

27

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
1 4 17
2 5 18
3 6 16
1 7 5
2 8 6
3 9 4
1 10 20
2 11 21
3 12 19
1 13 8
2 14 9
3 15 7
1 16 23
2 17 24
3 18 22
1 19 11
2 20 12
3 21 10
1 22 26
2 23 27
3 24 25
1 25 14
2 26 15
3 27 13
4 7 20
5 8 21
6 9 19
4 10 8
5 11 9
6 12 7
4 13 2...

result:

ok accepted

Test #15:

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

input:

81

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
1 4 44
2 5 45
3 6 43
1 7 5
2 8 6
3 9 4
1 10 47
2 11 48
3 12 46
1 1...

result:

ok accepted

Test #16:

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

input:

243

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #17:

score: 0
Accepted
time: 6ms
memory: 6440kb

input:

729

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #18:

score: 0
Accepted
time: 75ms
memory: 7316kb

input:

2187

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Subtask #3:

score: 0
Wrong Answer

Test #19:

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

input:

1

output:


result:

ok accepted

Test #20:

score: -9.09091
Wrong Answer
time: 0ms
memory: 3808kb

input:

25

output:

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

result:

wrong answer wrong construction

Subtask #4:

score: 0
Wrong Answer

Test #24:

score: 0
Wrong Answer
time: 0ms
memory: 3876kb

input:

7

output:

1 2 3
4 5 6
7 4 2
7 5 3
7 6 1
1 4 5
2 5 6
3 6 4

result:

wrong answer wrong construction

Subtask #5:

score: 0
Wrong Answer

Test #29:

score: 0
Wrong Answer
time: 0ms
memory: 3792kb

input:

13

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 7 2
13 8 3
13 9 1
13 10 5
13 11 6
13 12 4
1 4 8
2 5 9
3 6 7
1 7 5
2 8 6
3 9 4
1 10 11
2 11 12
3 12 10
4 7 11
5 8 12
6 9 10
4 10 2
5 11 3
6 12 1
7 10 8
8 11 9
9 12 7

result:

wrong answer wrong construction

Subtask #6:

score: 0
Wrong Answer

Test #34:

score: 0
Wrong Answer
time: 0ms
memory: 3728kb

input:

19

output:

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

result:

wrong answer wrong construction

Subtask #7:

score: 9.09091
Accepted

Test #39:

score: 9.09091
Accepted
time: 0ms
memory: 3908kb

input:

3

output:

1 2 3

result:

ok accepted

Test #40:

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

input:

27

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
1 4 17
2 5 18
3 6 16
1 7 5
2 8 6
3 9 4
1 10 20
2 11 21
3 12 19
1 13 8
2 14 9
3 15 7
1 16 23
2 17 24
3 18 22
1 19 11
2 20 12
3 21 10
1 22 26
2 23 27
3 24 25
1 25 14
2 26 15
3 27 13
4 7 20
5 8 21
6 9 19
4 10 8
5 11 9
6 12 7
4 13 2...

result:

ok accepted

Test #41:

score: 0
Accepted
time: 153ms
memory: 7756kb

input:

2979

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #42:

score: 0
Accepted
time: 139ms
memory: 7728kb

input:

2955

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #43:

score: 0
Accepted
time: 36ms
memory: 6112kb

input:

1419

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Subtask #8:

score: 9.09091
Accepted

Test #44:

score: 9.09091
Accepted
time: 0ms
memory: 3804kb

input:

21

output:

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

result:

ok accepted

Test #45:

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

input:

45

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
1 4 26
2 5 27
3 6 25
1 7 5
2 8 6
3 9 4
1 10 29
2 11 30
3 12 28
1 13 8
2 14 9
3 15 7
1 16 32
2 17 33
3 18 31
1 19 11
2 20 12
3 21 10
1 22 35
2 23 36
3 24 34
1 25 14
2 26 15
3 ...

result:

ok accepted

Test #46:

score: 0
Accepted
time: 151ms
memory: 7700kb

input:

2997

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #47:

score: 0
Accepted
time: 149ms
memory: 7752kb

input:

2973

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #48:

score: 0
Accepted
time: 60ms
memory: 6344kb

input:

1869

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Subtask #9:

score: 9.09091
Accepted

Test #49:

score: 9.09091
Accepted
time: 0ms
memory: 3920kb

input:

9

output:

1 2 3
4 5 6
7 8 9
1 4 8
2 5 9
3 6 7
1 7 5
2 8 6
3 9 4
4 7 2
5 8 3
6 9 1

result:

ok accepted

Test #50:

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

input:

33

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
1 4 20
2 5 21
3 6 19
1 7 5
2 8 6
3 9 4
1 10 23
2 11 24
3 12 22
1 13 8
2 14 9
3 15 7
1 16 26
2 17 27
3 18 25
1 19 11
2 20 12
3 21 10
1 22 29
2 23 30
3 24 28
1 25 14
2 26 15
3 27 13
1 28 32
2 29 33
3 30 31
1 31 1...

result:

ok accepted

Test #51:

score: 0
Accepted
time: 154ms
memory: 7644kb

input:

2985

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #52:

score: 0
Accepted
time: 143ms
memory: 7796kb

input:

2961

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #53:

score: 0
Accepted
time: 70ms
memory: 7192kb

input:

2025

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Subtask #10:

score: 9.09091
Accepted

Test #54:

score: 9.09091
Accepted
time: 0ms
memory: 3808kb

input:

15

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
1 4 11
2 5 12
3 6 10
1 7 5
2 8 6
3 9 4
1 10 14
2 11 15
3 12 13
1 13 8
2 14 9
3 15 7
4 7 14
5 8 15
6 9 13
4 10 8
5 11 9
6 12 7
4 13 2
5 14 3
6 15 1
7 10 2
8 11 3
9 12 1
7 13 11
8 14 12
9 15 10
10 13 5
11 14 6
12 15 4

result:

ok accepted

Test #55:

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

input:

39

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
1 4 23
2 5 24
3 6 22
1 7 5
2 8 6
3 9 4
1 10 26
2 11 27
3 12 25
1 13 8
2 14 9
3 15 7
1 16 29
2 17 30
3 18 28
1 19 11
2 20 12
3 21 10
1 22 32
2 23 33
3 24 31
1 25 14
2 26 15
3 27 13
1 28 35
2 29...

result:

ok accepted

Test #56:

score: 0
Accepted
time: 147ms
memory: 7696kb

input:

2991

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #57:

score: 0
Accepted
time: 156ms
memory: 7684kb

input:

2967

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Test #58:

score: 0
Accepted
time: 43ms
memory: 7332kb

input:

1719

output:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
22 23 24
25 26 27
28 29 30
31 32 33
34 35 36
37 38 39
40 41 42
43 44 45
46 47 48
49 50 51
52 53 54
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
76 77 78
79 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 95 96
97 98 99
100 101 102
...

result:

ok accepted

Subtask #11:

score: 0
Skipped

Dependency #1:

0%