結果

問題 No.1407 Kindness
ユーザー nasubi24nasubi24
提出日時 2021-02-26 22:27:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2024-04-10 13:11:38
合計ジャッジ時間 5,743 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,880 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 24 ms
10,880 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 25 ms
10,752 KB
testcase_06 AC 25 ms
10,752 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 25 ms
10,752 KB
testcase_09 AC 24 ms
10,752 KB
testcase_10 AC 24 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 295 ms
14,464 KB
testcase_13 AC 80 ms
11,520 KB
testcase_14 AC 99 ms
11,904 KB
testcase_15 AC 280 ms
14,208 KB
testcase_16 AC 170 ms
12,800 KB
testcase_17 AC 120 ms
12,288 KB
testcase_18 AC 118 ms
12,160 KB
testcase_19 AC 240 ms
13,824 KB
testcase_20 AC 204 ms
13,312 KB
testcase_21 AC 38 ms
10,880 KB
testcase_22 AC 44 ms
11,136 KB
testcase_23 AC 195 ms
13,312 KB
testcase_24 AC 330 ms
14,848 KB
testcase_25 AC 119 ms
12,032 KB
testcase_26 AC 159 ms
12,672 KB
testcase_27 AC 41 ms
10,880 KB
testcase_28 AC 265 ms
14,336 KB
testcase_29 AC 32 ms
10,752 KB
testcase_30 AC 295 ms
14,592 KB
testcase_31 AC 83 ms
11,520 KB
testcase_32 AC 262 ms
13,696 KB
testcase_33 AC 109 ms
11,904 KB
testcase_34 AC 203 ms
13,184 KB
testcase_35 AC 93 ms
11,648 KB
testcase_36 AC 33 ms
10,752 KB
testcase_37 AC 332 ms
14,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=input()
m=len(n)
mod=10**9+7
num=[1,45]
for i in range(m):
    num.append((num[-1]+1)*45)
    num[-1]%=mod
if m==1:
    ans=0
else:
    ans=num[m-1]
cnt=1
for i in range(m):
    a=int(n[i])
    ans+=cnt*((a-1)*a//2)*pow(45,m-i-1,mod)
    ans%=mod
    cnt*=a
    cnt%=mod
ans+=cnt
ans%=mod
print(ans)
0