結果

問題 No.1086 桁和の桁和2
ユーザー titiatitia
提出日時 2020-06-19 23:20:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 107,752 KB
最終ジャッジ日時 2023-09-16 15:34:45
合計ジャッジ時間 11,675 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,344 KB
testcase_01 AC 70 ms
71,364 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
71,652 KB
testcase_09 AC 70 ms
71,412 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 122 ms
76,848 KB
testcase_16 AC 338 ms
95,184 KB
testcase_17 AC 99 ms
76,736 KB
testcase_18 AC 440 ms
106,612 KB
testcase_19 AC 375 ms
100,348 KB
testcase_20 AC 112 ms
76,844 KB
testcase_21 AC 331 ms
95,168 KB
testcase_22 AC 435 ms
107,280 KB
testcase_23 AC 295 ms
92,892 KB
testcase_24 AC 231 ms
87,104 KB
testcase_25 AC 384 ms
102,904 KB
testcase_26 AC 319 ms
95,020 KB
testcase_27 AC 254 ms
88,892 KB
testcase_28 AC 222 ms
85,608 KB
testcase_29 AC 236 ms
87,136 KB
testcase_30 AC 454 ms
106,472 KB
testcase_31 AC 447 ms
107,520 KB
testcase_32 AC 445 ms
107,752 KB
testcase_33 AC 447 ms
107,524 KB
testcase_34 AC 445 ms
106,552 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
L=list(map(int,input().split()))
R=list(map(int,input().split()))
D=list(map(int,input().split()))

D.append(0)

mod=10**9+7

ANS=1

NI=pow(9,mod-2,mod)

for i in range(N):

    if D[i]==D[i-1]:
        ANS=ANS*(1+(pow(10,R[i],mod)-pow(10,L[i],mod))*NI)%mod
    else:
        ANS=ANS*(pow(10,R[i],mod)-pow(10,L[i],mod))*NI%mod
        

print(ANS%mod)
0