Submission #944218
Source Code Expand
M=10**9+7 gets hw=0;t=gets.split.map{|s|[hw<hw=h=s.to_i,h]} hw=0;a=gets.split.reverse.map{|s|[hw<hw=h=s.to_i,h]}.reverse p t.zip(a).reduce(1){|p,((f1,h1),(f2,h2))| break 0 if f1&&f2&&h1!=h2 || f1&&!f2&&h1>h2 || !f1&&f2&&h1<h2 !f1&&!f2 ? p*[h1,h2].min%M : p }
Submission Info
Submission Time | |
---|---|
Task | C - Two Alpinists |
User | angel_p_57 |
Language | Ruby (2.3.3) |
Score | 400 |
Code Size | 271 Byte |
Status | AC |
Exec Time | 237 ms |
Memory | 31732 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 11 ms | 1788 KB |
0_001.txt | AC | 11 ms | 1788 KB |
0_002.txt | AC | 11 ms | 1788 KB |
0_003.txt | AC | 11 ms | 1788 KB |
1_004.txt | AC | 11 ms | 1788 KB |
1_005.txt | AC | 11 ms | 1788 KB |
1_006.txt | AC | 11 ms | 1788 KB |
1_007.txt | AC | 11 ms | 1788 KB |
1_008.txt | AC | 236 ms | 31732 KB |
1_009.txt | AC | 155 ms | 29556 KB |
1_010.txt | AC | 207 ms | 31352 KB |
1_011.txt | AC | 230 ms | 31512 KB |
1_012.txt | AC | 154 ms | 30708 KB |
1_013.txt | AC | 236 ms | 31384 KB |
1_014.txt | AC | 155 ms | 31224 KB |
1_015.txt | AC | 237 ms | 31508 KB |
1_016.txt | AC | 187 ms | 31348 KB |
1_017.txt | AC | 227 ms | 31332 KB |
1_018.txt | AC | 198 ms | 31252 KB |
1_019.txt | AC | 216 ms | 30964 KB |
1_020.txt | AC | 185 ms | 30836 KB |