QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#45838#4565. Rarest InsectsHuangHanSheng0 256ms3860kbC++171.9kb2022-08-24 15:41:212022-08-24 15:41:23

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 4ms
memory: 3808kb

input:

6
3
3
3
2
3
2
2
2
1
2
1
1
1

output:

8
0 0
8
0 1
8
0 2
8
0 3
8
0 4
8
0 5
8
2
8
1 0
8
2
8
1 1
8
2
8
1 2
8
2
8
0 2
8
1 3
8
2
8
1 4
8
2
8
0 4
8
1 5
8
2
8
0 5
8
1 2
8
1 4
8
1 5
8
0 0
8
0 1
8
0 3
8
2
8
1 0
8
2
8
0 0
8
1 1
8
2
8
1 3
8
2
8
0 3
8
1 0
8
1 3
8
0 1
8
2
8
1 1
8
0 1
8
2
8
3 1

result:

ok 

Test #2:

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

input:

2
2
1
1
0

output:

8
0 0
8
0 1
8
2
8
1 0
8
2
8
0 0
8
1 1
8
2
8
0 1
8
1 0
8
1 1
8
2
8
3 2

result:

ok 

Test #3:

score: -10
Wrong Answer
time: 2ms
memory: 3832kb

input:

2
1
1
0
1
0
0

output:

8
0 0
8
0 1
8
2
8
1 0
8
2
8
1 1
8
2
8
0 1
8
1 1
8
0 0
8
2
8
1 0
8
2
8
0 0
8
1 0
8
2
8
3 2

result:

wrong answer Wrong answer.

Subtask #2:

score: 0
Wrong Answer

Test #24:

score: 15
Accepted
time: 2ms
memory: 3860kb

input:

1000
1000
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
99...

output:

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

result:

ok 

Test #25:

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

input:

1000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

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

result:

ok 

Test #26:

score: 0
Accepted
time: 152ms
memory: 3836kb

input:

999
33
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
2
1
1
1
1
1
1
2
2
2
2
2
2
2
2
1
2
2
1
2
2
2
2
1
1
1
1
2
2
1
2
1
1
2
2
2
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

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

result:

ok 

Test #27:

score: 0
Accepted
time: 94ms
memory: 3828kb

input:

999
48
1
1
1
1
1
2
1
1
1
2
2
1
1
1
2
1
1
1
1
1
2
2
1
2
1
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
1
2
2
2
2
1
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2...

output:

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

result:

ok 

Test #28:

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

input:

996
995
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
994
...

output:

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

result:

ok 

Test #29:

score: 0
Accepted
time: 12ms
memory: 3860kb

input:

995
496
495
496
496
496
496
496
495
495
495
496
496
496
495
496
496
495
495
496
496
496
496
495
495
495
495
496
495
496
496
496
495
495
495
495
495
495
496
496
495
495
496
495
495
495
495
496
496
496
495
496
496
496
495
495
495
495
495
496
495
495
495
496
496
495
496
496
495
496
496
496
495
496
496
...

output:

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

result:

ok 

Test #30:

score: 0
Accepted
time: 19ms
memory: 3700kb

input:

998
249
249
249
249
249
248
249
249
249
249
249
248
249
248
248
249
248
249
249
249
249
249
249
248
249
249
248
249
249
249
249
249
249
249
249
249
249
249
249
249
249
249
248
248
248
249
249
248
249
249
249
249
248
248
249
249
249
249
249
249
249
248
249
248
249
248
248
248
248
249
248
249
249
249
...

output:

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

result:

ok 

Test #31:

score: 0
Accepted
time: 10ms
memory: 3840kb

input:

998
34
1
1
1
1
1
2
1
1
2
1
1
1
1
1
1
2
2
1
1
2
1
2
2
1
1
2
2
1
2
2
1
2
1
1
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
1
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

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

result:

ok 

Test #32:

score: -15
Wrong Answer
time: 256ms
memory: 3740kb

input:

1000
217
217
216
217
217
217
217
217
217
216
217
216
217
217
217
217
216
217
217
216
217
217
217
217
217
216
217
217
217
217
217
216
217
217
217
217
216
217
217
217
216
217
217
217
217
217
217
217
216
217
217
217
217
217
217
217
217
216
217
217
217
217
217
217
216
217
217
217
217
216
217
217
217
217...

output:

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

result:

wrong answer Too many queries.

Subtask #3:

score: 0
Wrong Answer

Test #43:

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

input:

2
2
1
1
0

output:

8
0 0
8
0 1
8
2
8
1 0
8
2
8
0 0
8
1 1
8
2
8
0 1
8
1 0
8
1 1
8
2
8
3 2

result:

ok 

Test #44:

score: 0
Wrong Answer
time: 3ms
memory: 3748kb

input:

2
1
1
0
1
0
0

output:

8
0 0
8
0 1
8
2
8
1 0
8
2
8
1 1
8
2
8
0 1
8
1 1
8
0 0
8
2
8
1 0
8
2
8
0 0
8
1 0
8
2
8
3 2

result:

wrong answer Wrong answer.