結果

問題 No.1086 桁和の桁和2
ユーザー shotoyooshotoyoo
提出日時 2021-06-19 13:51:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 109,988 KB
最終ジャッジ日時 2023-09-05 00:47:55
合計ジャッジ時間 14,089 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,444 KB
testcase_01 AC 68 ms
71,148 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 70 ms
71,568 KB
testcase_09 AC 70 ms
71,608 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 120 ms
77,656 KB
testcase_16 AC 335 ms
95,200 KB
testcase_17 AC 99 ms
77,056 KB
testcase_18 AC 432 ms
108,824 KB
testcase_19 AC 370 ms
101,784 KB
testcase_20 AC 110 ms
77,492 KB
testcase_21 AC 325 ms
95,744 KB
testcase_22 AC 436 ms
109,424 KB
testcase_23 AC 292 ms
93,716 KB
testcase_24 AC 226 ms
90,020 KB
testcase_25 AC 379 ms
104,796 KB
testcase_26 AC 321 ms
95,504 KB
testcase_27 AC 252 ms
92,108 KB
testcase_28 AC 221 ms
88,440 KB
testcase_29 AC 239 ms
90,160 KB
testcase_30 AC 441 ms
108,824 KB
testcase_31 AC 439 ms
109,712 KB
testcase_32 AC 444 ms
109,820 KB
testcase_33 AC 442 ms
109,616 KB
testcase_34 AC 450 ms
108,740 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))

M = 10**9+7
n = int(input())
l = list(map(int, input().split()))
r = list(map(int, input().split()))
d = list(map(int, input().split()))
ans = 1
prv = 0
inv9 = pow(9, M-2, M)
for i in range(n):
    dd = d[i] - prv
    prv = d[i]
    v = (pow(10, r[i], M) - pow(10, l[i], M)) * inv9 % M
    if dd==0:
        val = 1 + v
    else:
        val = v
    ans *= val
    ans %= M
print(ans%M)
0