結果

問題 No.1086 桁和の桁和2
ユーザー tamatotamato
提出日時 2020-06-25 12:43:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 422 ms / 3,000 ms
コード長 691 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 87,704 KB
実行使用メモリ 107,760 KB
最終ジャッジ日時 2023-09-30 00:03:41
合計ジャッジ時間 9,623 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,672 KB
testcase_01 AC 61 ms
71,496 KB
testcase_02 AC 61 ms
71,612 KB
testcase_03 AC 60 ms
71,572 KB
testcase_04 AC 63 ms
71,628 KB
testcase_05 AC 138 ms
107,172 KB
testcase_06 AC 63 ms
71,740 KB
testcase_07 AC 59 ms
71,304 KB
testcase_08 AC 61 ms
71,648 KB
testcase_09 AC 60 ms
71,652 KB
testcase_10 AC 97 ms
92,836 KB
testcase_11 AC 68 ms
77,532 KB
testcase_12 AC 65 ms
75,864 KB
testcase_13 AC 108 ms
99,544 KB
testcase_14 AC 91 ms
89,304 KB
testcase_15 AC 104 ms
77,024 KB
testcase_16 AC 299 ms
95,036 KB
testcase_17 AC 85 ms
76,696 KB
testcase_18 AC 401 ms
106,776 KB
testcase_19 AC 339 ms
100,320 KB
testcase_20 AC 96 ms
76,912 KB
testcase_21 AC 300 ms
95,296 KB
testcase_22 AC 395 ms
107,260 KB
testcase_23 AC 269 ms
92,752 KB
testcase_24 AC 205 ms
87,476 KB
testcase_25 AC 352 ms
103,200 KB
testcase_26 AC 298 ms
95,008 KB
testcase_27 AC 233 ms
89,256 KB
testcase_28 AC 210 ms
85,904 KB
testcase_29 AC 226 ms
87,516 KB
testcase_30 AC 415 ms
106,492 KB
testcase_31 AC 411 ms
107,760 KB
testcase_32 AC 419 ms
107,456 KB
testcase_33 AC 422 ms
107,360 KB
testcase_34 AC 411 ms
106,552 KB
testcase_35 AC 123 ms
106,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    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()))

    ans = 1
    inv9 = pow(9, mod-2, mod)
    flg = 1
    prev = 0
    for d, l, r in zip(D, L, R):
        if d == 0:
            if not flg:
                print(0)
                exit()
        else:
            flg = 0
            a = ((pow(10, r, mod) - pow(10, l, mod))%mod * inv9)%mod
            if d == prev:
                a = (a+1)%mod
            prev = d
            ans = (ans * a)%mod
    print(ans)


if __name__ == '__main__':
    main()
0