QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#499317#9134. Building a Fenceucup-team1657TL 933ms3688kbC++203.9kb2024-07-31 12:18:582024-07-31 12:19:00

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

7
7 9 4
1 1 2
1 1 4
4 6 2
3 3 5
10 6 4
1 11 5

output:

8
2
4
10
4
8
5

result:

ok 7 numbers

Test #2:

score: 0
Accepted
time: 295ms
memory: 3640kb

input:

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

output:

4
2
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
6
3
2
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
8
4
4
2
4
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
10
5
4
4
2
4
4
3
4
4
4
4
4
4
4
4
4
4
4
4
12
6
4
3
4
2
4
4
4
3
4
4
4
4
4
4
4
4
4
4
14
7
5
4
4
4
2
4
4
4
4
3
4
4
4
4
4
4
4
4
16
8
6
4
4
4
4
2
4
4
4
4
4
3
4
4
4
4
4
4
18
9
6
5
4
3
4
4...

result:

ok 8000 numbers

Test #3:

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

input:

8000
21 21 21
21 21 22
21 21 23
21 21 24
21 21 25
21 21 26
21 21 27
21 21 28
21 21 29
21 21 30
21 21 31
21 21 32
21 21 33
21 21 34
21 21 35
21 21 36
21 21 37
21 21 38
21 21 39
21 21 40
21 22 21
21 22 22
21 22 23
21 22 24
21 22 25
21 22 26
21 22 27
21 22 28
21 22 29
21 22 30
21 22 31
21 22 32
21 22 3...

output:

4
4
4
4
4
4
4
3
4
4
4
4
4
4
4
4
4
4
4
4
5
4
4
4
4
4
4
4
4
4
4
3
4
4
4
4
4
4
4
4
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
4
4
4
4
4
4
4
3
4
4
3
4
4
4
4
4
4
4
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
4
4
4
4
4
4
4
4
4
4
3
4
4
4
4
4
4
5
5
5
4
4
4
4
4
4
4
4
3
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
...

result:

ok 8000 numbers

Test #4:

score: 0
Accepted
time: 380ms
memory: 3616kb

input:

8000
41 41 41
41 41 42
41 41 43
41 41 44
41 41 45
41 41 46
41 41 47
41 41 48
41 41 49
41 41 50
41 41 51
41 41 52
41 41 53
41 41 54
41 41 55
41 41 56
41 41 57
41 41 58
41 41 59
41 41 60
41 42 41
41 42 42
41 42 43
41 42 44
41 42 45
41 42 46
41 42 47
41 42 48
41 42 49
41 42 50
41 42 51
41 42 52
41 42 5...

output:

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
4
4
4
4
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
4
4
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
...

result:

ok 8000 numbers

Test #5:

score: 0
Accepted
time: 933ms
memory: 3552kb

input:

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

output:

84
42
28
21
17
14
12
11
10
9
8
7
7
6
6
6
5
5
5
5
86
43
29
22
18
15
13
11
10
9
8
8
7
7
6
6
6
5
5
5
88
44
30
22
18
15
13
11
10
9
8
8
7
7
6
6
6
5
5
5
90
45
30
23
18
15
13
12
10
9
9
8
7
7
6
6
6
5
5
5
92
46
31
23
19
16
14
12
11
10
9
8
8
7
7
6
6
6
5
5
94
47
32
24
19
16
14
12
11
10
9
8
8
7
7
6
6
6
5
5
96
4...

result:

ok 8000 numbers

Test #6:

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

input:

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

output:

164
82
55
41
33
28
24
21
19
17
15
14
13
12
11
11
10
10
9
9
166
83
56
42
34
28
24
21
19
17
16
14
13
12
12
11
10
10
9
9
168
84
56
42
34
28
24
21
19
17
16
14
13
12
12
11
10
10
9
9
170
85
57
43
34
29
25
22
19
17
16
15
14
13
12
11
10
10
9
9
172
86
58
43
35
29
25
22
20
18
16
15
14
13
12
11
11
10
10
9
174
...

result:

ok 8000 numbers

Test #7:

score: 0
Accepted
time: 13ms
memory: 3620kb

input:

8000
1 1 21
1 1 22
1 1 23
1 1 24
1 1 25
1 1 26
1 1 27
1 1 28
1 1 29
1 1 30
1 1 31
1 1 32
1 1 33
1 1 34
1 1 35
1 1 36
1 1 37
1 1 38
1 1 39
1 1 40
1 2 21
1 2 22
1 2 23
1 2 24
1 2 25
1 2 26
1 2 27
1 2 28
1 2 29
1 2 30
1 2 31
1 2 32
1 2 33
1 2 34
1 2 35
1 2 36
1 2 37
1 2 38
1 2 39
1 2 40
1 3 21
1 3 22
1...

output:

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

result:

ok 8000 numbers

Test #8:

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

input:

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

output:

244
122
82
61
49
41
35
31
28
25
23
21
19
18
17
16
15
14
13
13
246
123
82
62
50
41
36
31
28
25
23
21
19
18
17
16
15
14
13
13
248
124
83
62
50
42
36
31
28
25
23
21
20
18
17
16
15
14
14
13
250
125
84
63
50
42
36
32
28
25
23
21
20
18
17
16
15
14
14
13
252
126
84
63
51
42
36
32
28
26
23
21
20
18
17
16
15...

result:

ok 8000 numbers

Test #9:

score: -100
Time Limit Exceeded

input:

8000
61 61 31
61 61 32
61 61 33
61 61 34
61 61 35
61 61 36
61 61 37
61 61 38
61 61 39
61 61 40
61 61 41
61 61 42
61 61 43
61 61 44
61 61 45
61 61 46
61 61 47
61 61 48
61 61 49
61 61 50
61 62 31
61 62 32
61 62 33
61 62 34
61 62 35
61 62 36
61 62 37
61 62 38
61 62 39
61 62 40
61 62 41
61 62 42
61 62 4...

output:


result: