結果

問題 No.1086 桁和の桁和2
ユーザー wolgnikwolgnik
提出日時 2020-06-19 23:17:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 699 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 108,860 KB
最終ジャッジ日時 2023-09-16 15:25:49
合計ジャッジ時間 13,082 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,640 KB
testcase_01 AC 95 ms
71,612 KB
testcase_02 WA -
testcase_03 AC 91 ms
71,528 KB
testcase_04 AC 92 ms
71,520 KB
testcase_05 AC 156 ms
107,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 90 ms
71,776 KB
testcase_09 AC 90 ms
71,528 KB
testcase_10 AC 137 ms
100,108 KB
testcase_11 AC 103 ms
78,664 KB
testcase_12 AC 98 ms
77,104 KB
testcase_13 AC 141 ms
100,996 KB
testcase_14 AC 125 ms
95,204 KB
testcase_15 AC 166 ms
78,044 KB
testcase_16 AC 460 ms
99,592 KB
testcase_17 AC 135 ms
77,932 KB
testcase_18 AC 602 ms
108,064 KB
testcase_19 AC 499 ms
100,880 KB
testcase_20 AC 156 ms
78,140 KB
testcase_21 AC 452 ms
100,820 KB
testcase_22 AC 598 ms
108,024 KB
testcase_23 AC 407 ms
101,436 KB
testcase_24 AC 318 ms
93,128 KB
testcase_25 AC 518 ms
103,312 KB
testcase_26 AC 442 ms
100,956 KB
testcase_27 AC 350 ms
96,088 KB
testcase_28 AC 309 ms
90,924 KB
testcase_29 AC 333 ms
93,744 KB
testcase_30 AC 611 ms
108,564 KB
testcase_31 AC 610 ms
108,708 KB
testcase_32 AC 614 ms
108,656 KB
testcase_33 AC 614 ms
108,860 KB
testcase_34 AC 611 ms
108,556 KB
testcase_35 AC 157 ms
107,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
ls = list(map(int, input().split()))
rs = list(map(int, input().split()))
ds = list(map(int, input().split()))
mod = 10 ** 9 + 7

d = [0] * N
d[0] = ds[0]
for i in range(N - 1):
  d[i + 1] = ds[i + 1] - ds[i]
  if ds[i] > 0 and (ds[i + 1] == 0):
    print(0)
    exit(0)
#print(d)
res = 1
zeros = 0
for i in range(N):
  """
  if zeros == 1 and (d[i] == 0):
    continue
  zeros = d[i] == 0
  """
  l = ls[i]
  r = rs[i]
  
  t = (pow(10, r, mod) - 1) * pow(9, mod - 2, mod) % mod
  if l: t -= (pow(10, l, mod) - 1) * pow(9, mod - 2, mod) % mod
  res *= t + (d[i] == 0) * (i > 0)
  res %= mod
print(res)
0