Submission #1966994
Source Code Expand
N = int(input()) T = list(map(int,input().split())) A = list(map(int,input().split())) MOD = 10**9+7 ans = 1 for i in range(N): fixed = -1 if i == 0 or T[i-1] < T[i]: fixed = T[i] if i == N-1 or A[i+1] < A[i]: if fixed > 0 and fixed != A[i]: print(0) exit() fixed = A[i] if fixed < 0: ans = (ans * min(T[i],A[i])) % MOD print(ans)
Submission Info
Submission Time | |
---|---|
Task | C - Two Alpinists |
User | prd_xxx |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 422 Byte |
Status | WA |
Exec Time | 167 ms |
Memory | 19136 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 17 ms | 3064 KB |
0_001.txt | AC | 17 ms | 3064 KB |
0_002.txt | AC | 17 ms | 3064 KB |
0_003.txt | AC | 17 ms | 3064 KB |
1_004.txt | AC | 17 ms | 3064 KB |
1_005.txt | AC | 17 ms | 3064 KB |
1_006.txt | WA | 17 ms | 3064 KB |
1_007.txt | AC | 17 ms | 3064 KB |
1_008.txt | AC | 160 ms | 18396 KB |
1_009.txt | AC | 121 ms | 18532 KB |
1_010.txt | AC | 132 ms | 18076 KB |
1_011.txt | AC | 148 ms | 18416 KB |
1_012.txt | AC | 78 ms | 19136 KB |
1_013.txt | AC | 158 ms | 18244 KB |
1_014.txt | AC | 77 ms | 18224 KB |
1_015.txt | AC | 162 ms | 18276 KB |
1_016.txt | AC | 93 ms | 18228 KB |
1_017.txt | AC | 167 ms | 16796 KB |
1_018.txt | WA | 159 ms | 16960 KB |
1_019.txt | AC | 147 ms | 15228 KB |
1_020.txt | WA | 145 ms | 13408 KB |