結果

問題 No.1086 桁和の桁和2
ユーザー titia
提出日時 2020-06-19 23:17:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 236,212 KB
最終ジャッジ日時 2024-07-03 15:37:43
合計ジャッジ時間 5,388 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2 TLE * 1
other -- * 31
権限があれば一括ダウンロードができます

ソースコード

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

for i in range(N):

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

print(ANS%mod)
0