結果

問題 No.1407 Kindness
ユーザー ayaoniayaoni
提出日時 2021-02-26 22:07:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 792 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 82,384 KB
最終ジャッジ日時 2024-04-10 12:55:55
合計ジャッジ時間 4,568 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,096 KB
testcase_01 AC 34 ms
53,148 KB
testcase_02 AC 34 ms
52,684 KB
testcase_03 AC 36 ms
52,928 KB
testcase_04 AC 35 ms
53,812 KB
testcase_05 AC 35 ms
53,464 KB
testcase_06 AC 34 ms
52,604 KB
testcase_07 AC 35 ms
52,332 KB
testcase_08 AC 35 ms
52,956 KB
testcase_09 AC 37 ms
53,288 KB
testcase_10 AC 34 ms
53,216 KB
testcase_11 AC 35 ms
53,004 KB
testcase_12 AC 149 ms
81,872 KB
testcase_13 AC 84 ms
76,604 KB
testcase_14 AC 90 ms
77,160 KB
testcase_15 AC 138 ms
80,864 KB
testcase_16 AC 105 ms
78,956 KB
testcase_17 AC 93 ms
77,620 KB
testcase_18 AC 90 ms
77,684 KB
testcase_19 AC 133 ms
80,992 KB
testcase_20 AC 124 ms
79,800 KB
testcase_21 AC 64 ms
72,160 KB
testcase_22 AC 67 ms
74,596 KB
testcase_23 AC 115 ms
79,852 KB
testcase_24 AC 156 ms
82,316 KB
testcase_25 AC 90 ms
77,608 KB
testcase_26 AC 103 ms
79,024 KB
testcase_27 AC 64 ms
74,776 KB
testcase_28 AC 136 ms
80,888 KB
testcase_29 AC 58 ms
70,956 KB
testcase_30 AC 147 ms
81,888 KB
testcase_31 AC 80 ms
77,276 KB
testcase_32 AC 136 ms
80,952 KB
testcase_33 AC 87 ms
77,116 KB
testcase_34 AC 116 ms
79,124 KB
testcase_35 AC 83 ms
76,880 KB
testcase_36 AC 58 ms
70,388 KB
testcase_37 AC 133 ms
82,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = LI2()
mod = 10**9+7

l = len(N)
a = 1
ans = 0
for i in range(l):
    n = N[i]
    r = sum(j for j in range(1,n))
    if i == l-1:
        r += n
    x = a*r*pow(45,l-1-i,mod)
    if i == 0:
        for j in range(1,l):
            x += pow(45,j,mod)
            x %= mod
    ans += x
    ans %= mod
    a *= n
    a %= mod

print(ans)

0