Submission #1472427


Source Code Expand

#coding=UTF-8

N=int(input())
mozir=input()
hyo=mozir.split(' ')

Rec_LTR=[int(mono) for mono in hyo]

mozir=input()
hyo=mozir.split(' ')

Rec_RTL=[int(mono) for mono in hyo]

LTR_hani=[]
highest=0
for idx in range(0,N,1):
    if Rec_LTR[idx]>highest:
        highest=Rec_LTR[idx]
        LTR_hani.append([highest,highest])
    else:
        LTR_hani.append([highest,1])

RTL_hani=[None]*N
highest=0
for idx in range(N-1,-1,-1):
    if Rec_RTL[idx]>highest:
        highest=Rec_RTL[idx]
        RTL_hani[idx]=[highest,highest]
    else:
        RTL_hani[idx]=[highest,1]

#concat
ans=1
hou=1000000007
for idx in range(0,N,1):
    # prod set
    ue=min(RTL_hani[idx][0],LTR_hani[idx][0])
    shita=max(RTL_hani[idx][1],LTR_hani[idx][1])
    ans=(ans*max((ue-shita+1),0))%hou

print(ans)

Submission Info

Submission Time
Task C - Two Alpinists
User mamonbo
Language Python (3.4.3)
Score 400
Code Size 827 Byte
Status AC
Exec Time 290 ms
Memory 39744 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 21
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 AC 17 ms 3064 KB
1_007.txt AC 17 ms 3064 KB
1_008.txt AC 287 ms 39744 KB
1_009.txt AC 283 ms 38976 KB
1_010.txt AC 290 ms 39276 KB
1_011.txt AC 288 ms 39536 KB
1_012.txt AC 279 ms 39488 KB
1_013.txt AC 290 ms 39552 KB
1_014.txt AC 280 ms 39596 KB
1_015.txt AC 279 ms 39524 KB
1_016.txt AC 276 ms 39488 KB
1_017.txt AC 282 ms 38172 KB
1_018.txt AC 279 ms 38232 KB
1_019.txt AC 285 ms 36472 KB
1_020.txt AC 267 ms 32864 KB