QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#843199#9968. Just Zerosucup-team5064#RE 12ms3872kbC++203.9kb2025-01-04 17:17:422025-01-04 17:17:43

详细

Test #1:

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

input:

3 4 6
1010
1101
0010
R 2
P 3 1
K 2
P 2 1
K 4
P 3 4

output:

3
2
3
4
3
3
4

result:

ok 7 numbers

Test #2:

score: 0
Accepted
time: 11ms
memory: 3872kb

input:

3 4 100000
0100
0011
0011
R 3
K 1
R 2
K 4
R 3
K 2
P 1 1
K 1
R 1
P 1 4
K 4
K 1
K 4
R 3
K 2
K 2
R 1
K 1
K 4
P 3 2
P 2 1
K 1
R 1
P 3 1
R 3
K 3
P 3 2
P 1 3
K 1
R 1
P 1 1
R 1
P 2 1
R 3
P 3 1
R 2
K 2
R 1
R 1
R 3
P 1 3
R 3
K 3
R 2
R 1
P 3 4
K 1
K 1
P 1 4
R 3
K 1
P 1 2
R 1
K 3
P 2 2
R 1
P 1 1
K 4
R 2
P 3 4
...

output:

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

result:

ok 100001 numbers

Test #3:

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

input:

4 3 100000
110
110
010
000
K 2
K 3
K 2
R 4
P 3 3
K 3
K 2
R 4
R 2
R 1
P 3 2
R 3
K 1
K 1
R 1
K 3
P 1 3
R 2
K 2
K 3
R 3
P 4 1
K 2
P 1 1
R 3
R 1
R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
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
...

result:

ok 10001 numbers

Test #5:

score: 0
Accepted
time: 11ms
memory: 3564kb

input:

2 2 100000
11
01
K 1
R 1
K 2
R 1
K 1
P 2 2
K 2
R 2
P 2 1
K 2
R 1
R 1
K 1
K 1
R 2
P 1 2
P 2 2
K 2
R 2
K 1
R 2
P 2 1
R 1
K 2
P 1 1
P 1 1
P 1 1
P 2 2
K 1
R 2
P 2 2
P 2 2
P 1 2
P 2 1
R 2
P 2 2
P 2 1
K 2
K 2
P 2 2
P 2 1
R 1
R 1
K 2
K 2
P 2 1
R 1
P 1 2
R 2
P 1 1
R 2
R 1
P 2 1
P 1 1
K 1
K 2
R 1
P 2 1
R 1
K...

output:

2
2
2
2
1
1
2
1
2
2
1
1
1
1
1
2
2
2
2
1
1
1
1
2
1
1
1
1
1
2
1
2
1
2
1
2
2
1
2
1
2
2
1
2
1
2
2
1
1
2
2
2
1
1
2
1
1
1
1
2
1
0
1
2
1
2
1
0
1
2
1
2
1
2
2
2
2
2
2
1
2
1
1
1
1
2
1
2
1
1
1
2
2
2
1
1
1
2
2
1
1
1
2
2
1
2
1
1
2
1
2
1
1
1
0
1
1
1
1
2
2
1
2
1
2
2
1
0
1
2
1
2
1
2
1
0
1
0
1
2
1
2
1
0
1
1
1
1
1
1
...

result:

ok 100001 numbers

Test #6:

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

input:

8 100 100
1011100111011111110000100100100101000100111100011000001000101011001101001011010100110010110100010110
1001100100100101011101110000100001100001010100111011100111101000110011000010010001000010001101000001
0111000100001001100001111000111110100111100000010111100110110010110100000010011011100000...

output:

302
303
304
305
305
304
305
304
303
302
303
302
301
300
301
302
301
302
301
300
299
298
299
300
299
298
299
300
299
300
301
302
302
301
300
299
300
301
302
301
302
303
302
303
302
301
301
300
299
298
297
298
299
298
298
297
298
297
296
295
296
295
294
294
295
296
295
296
297
298
299
299
300
301
302
...

result:

ok 101 numbers

Test #7:

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

input:

7 100 100
0110101100110100101101011011110110011011111111001001111111111110011000000110010000110001001100000000
1011011110010100111101010001101000100110011111110111000110111110000101000010001001110110101101100101
0010010101110110010111010010000111000101110101111110110010110011100001101001010001101011...

output:

275
275
275
274
273
274
274
275
274
274
273
274
275
275
275
275
275
275
274
273
274
273
272
271
270
269
270
271
272
271
272
271
270
269
270
269
268
267
268
269
270
271
270
269
268
269
270
269
270
271
272
273
274
273
272
271
270
269
268
267
268
267
268
267
268
267
268
269
270
269
268
269
268
267
266
...

result:

ok 101 numbers

Test #8:

score: -100
Runtime Error

input:

6 100 100
1010111111000000010001111010011000101111101101010010001010100000000100001011010100001001101110110111
1100110100111000100000011001011111001010000011011011000011010100101110101110110000101001010110001011
0101000000000111000100010011100001001010011001010100110111010111111101001101010011101111...

output:


result: