QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#739281#9714. A Colorful GridI_be_wannaAC ✓44ms32692kbC++1411.7kb2024-11-12 21:19:312024-11-12 21:19:39

详细

Test #1:

score: 100
Accepted
time: 7ms
memory: 28004kb

input:

4
2 2 1
1 1 1 2 1
2 2 1
1 1 2 1 1
2 2 1
1 1 2 2 1
2 2 2
1 1 1 2 0
1 1 2 1 0

output:

Case #1: Yes
DD
UU
Case #2: Yes
RL
RL
Case #3: No
Case #4: No

result:

ok all accept

Test #2:

score: 0
Accepted
time: 7ms
memory: 28440kb

input:

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

output:

Case #1: Yes
DRLRLRLDDD
URLRLRLUUU
Case #2: Yes
DDRLRLDDDD
UURLRLUUUU
Case #3: Yes
RLRLRLDDDD
RLRLRLUUUU
Case #4: Yes
RLRLRLRLDD
RLRLRLRLUU

result:

ok all accept

Test #3:

score: 0
Accepted
time: 5ms
memory: 27584kb

input:

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

output:

Case #1: No
Case #2: Yes
RLRLRLRLD
RLRLRLRLU
Case #3: Yes
DRLRLRLDD
URLRLRLUU

result:

ok all accept

Test #4:

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

input:

4
2 9 1
1 1 2 9 1
2 10 1
1 1 2 10 1
3 4 1
1 1 3 4 1
4 4 1
1 1 4 4 1

output:

Case #1: No
Case #2: No
Case #3: Yes
RLDD
DDUU
UURL
Case #4: Yes
DDRL
UURL
RLDD
RLUU

result:

ok all accept

Test #5:

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

input:

4
2 10 5
1 1 2 3 1
1 7 2 10 1
1 3 2 5 0
1 4 2 6 0
1 5 2 7 0
2 10 6
1 1 2 3 1
1 7 2 10 1
1 2 2 4 0
1 3 2 5 0
1 4 2 6 0
1 5 2 7 0
2 10 7
1 1 2 3 1
1 7 2 10 1
1 2 2 4 0
1 3 2 5 0
1 4 2 6 0
1 5 2 7 0
1 6 2 8 0
2 10 7
1 1 2 2 1
1 7 2 10 1
1 2 2 4 0
1 3 2 5 0
1 4 2 6 0
1 5 2 7 0
1 2 2 3 0

output:

Case #1: Yes
DDRLRLDDDD
UURLRLUUUU
Case #2: Yes
DDRLRLDDDD
UURLRLUUUU
Case #3: No
Case #4: Yes
DRLRLRLDDD
URLRLRLUUU

result:

ok all accept

Test #6:

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

input:

2
4 4 1
2 2 3 3 0
4 4 2
2 2 3 3 0
3 3 4 1 0

output:

Case #1: Yes
DRLD
URLU
DRLD
URLU
Case #2: Yes
DRLD
URLU
DRLD
URLU

result:

ok all accept

Test #7:

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

input:

1
2 12 6
1 1 2 2 1
1 3 2 5 0
1 6 2 8 0
1 7 2 9 0
1 9 2 11 0
1 11 2 12 0

output:

Case #1: Yes
DDRLDDRLRLRL
UURLUURLRLRL

result:

ok all accept

Test #8:

score: 0
Accepted
time: 5ms
memory: 28208kb

input:

1
4 3 2
1 1 4 3 0
1 1 2 3 1

output:

Case #1: Yes
DRL
URL
DDD
UUU

result:

ok all accept

Test #9:

score: 0
Accepted
time: 35ms
memory: 32692kb

input:

2
20000 4 100000
1 1 1 4 1
4 3 13 2 0
4 3 6 4 1
2 1 6 2 0
1 3 10 3 0
4 4 13 3 0
1 4 5 4 0
2 4 10 4 0
3 4 7 1 0
2 4 12 3 0
1 2 9 2 0
4 2 9 1 1
4 1 7 4 1
1 3 11 3 0
1 1 4 4 0
3 3 9 2 0
2 3 9 4 0
3 4 4 2 0
2 4 6 1 0
1 3 2 1 1
3 2 4 2 0
2 1 7 4 0
2 4 7 2 0
4 2 8 4 1
3 1 6 1 0
3 4 9 2 0
1 1 7 1 0
1 3 9 3...

output:

Case #1: Yes
RLRL
RLRL
DDDD
UUUU
RLRL
RLRL
RLRL
RLRL
RLRL
DDDD
UUUU
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RLRL
RL...

result:

ok all accept

Test #10:

score: 0
Accepted
time: 44ms
memory: 31020kb

input:

2
6 15000 100000
1 1 6 1 1
3 2 1 8 0
1 4 5 5 1
3 3 3 12 0
6 2 3 8 0
1 3 5 5 1
4 2 4 3 1
6 2 1 7 0
6 3 6 5 1
4 1 6 7 0
5 2 3 4 1
1 4 4 11 0
2 6 1 16 0
2 5 6 7 0
6 2 5 12 0
5 4 3 6 0
2 1 2 9 0
6 5 3 10 0
3 1 3 4 1
2 6 5 15 0
6 6 5 9 1
3 5 2 15 0
6 1 6 6 0
6 4 2 6 0
6 6 4 8 1
2 5 6 10 0
5 2 4 11 0
2 5 ...

output:

Case #1: Yes
DDDDRLDDDRLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD...

result:

ok all accept

Test #11:

score: 0
Accepted
time: 41ms
memory: 31308kb

input:

2
10000 10 100000
1 1 1 10 1
4 1 11 3 0
7 4 12 3 0
7 2 11 6 0
4 7 5 1 1
9 9 14 10 0
10 3 12 6 0
1 5 3 8 1
4 4 7 8 1
8 2 10 10 1
4 7 12 4 0
9 4 11 3 0
4 2 10 9 1
5 3 15 9 0
10 1 16 7 0
5 9 10 7 1
8 7 15 10 0
5 2 9 8 1
9 10 10 2 1
7 6 10 3 1
9 6 12 4 0
1 4 3 1 1
4 10 9 3 1
4 5 14 9 0
1 8 9 1 1
4 3 10 ...

output:

Case #1: Yes
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
DDDDDDDDDD
UUUUUUUUUU
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
R...

result:

ok all accept

Test #12:

score: 0
Accepted
time: 40ms
memory: 30996kb

input:

2
5 20000 100000
1 1 5 1 1
4 5 5 8 1
3 1 1 3 1
4 2 4 12 1
3 5 2 11 1
1 2 5 5 1
1 4 2 12 1
3 4 5 6 1
3 2 5 8 1
2 5 4 7 1
3 5 1 8 1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RLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLR...

result:

ok all accept

Test #14:

score: 0
Accepted
time: 42ms
memory: 30760kb

input:

2
12000 7 100000
1 1 1 7 1
3 2 9 4 0
7 2 9 5 1
2 1 10 1 0
3 6 8 7 0
3 5 12 7 0
1 3 11 2 0
6 1 8 4 1
7 2 11 7 0
6 5 13 2 0
7 2 15 3 0
1 6 5 2 1
5 7 15 7 0
3 4 13 3 0
7 6 11 1 0
6 2 16 1 0
5 4 6 2 0
3 5 11 2 0
1 2 9 1 0
7 2 15 1 0
1 1 9 5 0
6 4 15 6 0
7 3 16 4 0
4 1 5 4 1
7 5 12 2 0
7 5 13 4 0
5 5 14 ...

output:

Case #1: Yes
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDDD
UUUUUUU
DDDDDRL
UUUUURL
DDDDDDD
UUUUUUU
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL
DDDDDRL
UUUUURL...

result:

ok all accept

Test #15:

score: 0
Accepted
time: 39ms
memory: 31224kb

input:

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

output:

Case #1: Yes
RLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLRLR...

result:

ok all accept

Test #16:

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

input:

10
4 9 20
1 1 4 1 1
1 2 4 5 0
3 3 4 8 0
3 2 2 9 0
3 1 4 9 0
3 2 2 9 0
3 2 1 6 0
2 3 1 9 0
4 3 3 9 0
4 3 4 6 0
3 1 3 7 0
3 2 3 9 0
1 1 3 9 0
4 2 4 6 0
3 3 2 9 0
3 2 3 9 0
2 1 3 7 0
2 1 3 7 0
4 4 2 9 0
1 4 3 9 0
9 4 20
1 1 1 4 1
1 3 9 2 0
1 1 9 1 0
3 4 9 1 0
1 2 9 2 0
3 2 4 4 1
1 2 6 2 1
1 1 7 3 0
2 2...

output:

Case #1: Yes
DDDRLDDDD
UUURLUUUU
DDDRLDDDD
UUURLUUUU
Case #2: Yes
RLRL
RLRL
RLRL
RLRL
RLRL
DDDD
UUUU
RLRL
RLRL
Case #3: Yes
DDDDRLDDD
UUUURLUUU
DDDDRLDDD
UUUURLUUU
Case #4: Yes
RLRL
DDDD
UUUU
RLRL
RLRL
RLRL
DDDD
UUUU
RLRL
Case #5: Yes
RLRL
DDDD
UUUU
RLRL
RLRL
RLRL
DDDD
UUUU
RLRL
Case #6: Yes
RLRL
RL...

result:

ok all accept

Test #17:

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

input:

10
5 10 20
1 1 5 1 1
1 1 1 9 0
4 2 1 4 1
3 3 1 6 0
4 5 1 6 0
2 5 2 7 0
4 4 5 9 0
1 3 4 8 0
2 5 2 8 0
2 1 4 2 1
2 3 2 10 0
1 1 4 2 1
1 2 1 6 0
2 2 3 7 0
2 3 2 10 0
1 3 3 10 0
4 1 3 6 0
1 2 3 6 0
2 4 1 10 0
2 1 2 8 0
10 5 20
1 1 1 5 1
4 5 10 4 0
3 4 4 3 1
1 3 6 2 0
4 2 5 1 1
2 1 10 3 0
1 1 5 3 1
2 3 4...

output:

Case #1: Yes
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
DDDDRLDDDD
UUUURLUUUU
Case #2: Yes
DDDRL
UUURL
DDDRL
UUURL
DDDDD
UUUUU
DDDRL
UUURL
DDDRL
UUURL
Case #3: No
Case #4: Yes
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
DDRLRLDDDD
UURLRLUUUU
Case #5: Yes
RLRLRLRLRL
RLRLRLRLRL
RLRLRLRLRL
DDRLDDDDRL
UURLUUUURL
Case #6: Ye...

result:

ok all accept

Test #18:

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

input:

100
3 4 5
1 1 3 1 1
3 2 3 4 1
2 3 1 4 1
1 1 3 4 0
3 1 2 4 0
3 4 5
1 1 3 1 1
3 3 1 4 0
2 3 1 4 0
1 2 2 4 0
1 3 1 4 0
4 3 5
1 1 1 3 1
1 1 4 1 0
3 2 4 2 0
1 2 4 1 0
3 2 4 2 0
3 4 5
1 1 3 1 1
1 3 2 4 0
2 3 1 4 0
2 3 1 4 0
2 1 1 3 1
3 4 5
1 1 3 1 1
2 2 1 4 1
2 1 1 4 0
1 1 2 4 0
3 1 2 2 0
4 3 5
1 1 1 3 1
...

output:

Case #1: Yes
RLRL
RLDD
RLUU
Case #2: Yes
RLRL
DDRL
UURL
Case #3: Yes
DRL
URL
DDD
UUU
Case #4: Yes
RLRL
DDRL
UURL
Case #5: Yes
RLRL
RLDD
RLUU
Case #6: Yes
DRL
URL
DDD
UUU
Case #7: Yes
DDD
UUU
DRL
URL
Case #8: Yes
RLRL
DDRL
UURL
Case #9: Yes
RLRL
DDRL
UURL
Case #10: Yes
DDD
UUU
DRL
URL
Case #11: Yes
D...

result:

ok all accept

Extra Test:

score: 0
Extra Test Passed