結果

問題 No.1407 Kindness
ユーザー marroncastlemarroncastle
提出日時 2021-03-15 11:02:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 84,856 KB
最終ジャッジ日時 2023-08-06 20:45:25
合計ジャッジ時間 5,001 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,080 KB
testcase_01 AC 76 ms
71,324 KB
testcase_02 AC 74 ms
71,232 KB
testcase_03 AC 72 ms
71,372 KB
testcase_04 AC 75 ms
71,400 KB
testcase_05 AC 73 ms
71,220 KB
testcase_06 AC 73 ms
71,208 KB
testcase_07 AC 73 ms
71,240 KB
testcase_08 AC 73 ms
71,152 KB
testcase_09 AC 74 ms
71,204 KB
testcase_10 AC 73 ms
71,200 KB
testcase_11 AC 74 ms
71,272 KB
testcase_12 AC 91 ms
83,844 KB
testcase_13 AC 82 ms
77,264 KB
testcase_14 AC 85 ms
78,004 KB
testcase_15 AC 91 ms
83,036 KB
testcase_16 AC 87 ms
80,092 KB
testcase_17 AC 83 ms
78,588 KB
testcase_18 AC 83 ms
78,836 KB
testcase_19 AC 90 ms
82,708 KB
testcase_20 AC 88 ms
81,216 KB
testcase_21 AC 82 ms
76,512 KB
testcase_22 AC 80 ms
76,404 KB
testcase_23 AC 89 ms
81,232 KB
testcase_24 AC 91 ms
84,772 KB
testcase_25 AC 85 ms
78,596 KB
testcase_26 AC 87 ms
80,032 KB
testcase_27 AC 83 ms
76,372 KB
testcase_28 AC 90 ms
82,952 KB
testcase_29 AC 82 ms
76,596 KB
testcase_30 AC 92 ms
83,868 KB
testcase_31 AC 84 ms
77,580 KB
testcase_32 AC 99 ms
83,060 KB
testcase_33 AC 88 ms
77,900 KB
testcase_34 AC 98 ms
80,924 KB
testcase_35 AC 88 ms
77,376 KB
testcase_36 AC 83 ms
76,464 KB
testcase_37 AC 91 ms
84,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = list(map(int,list(input())))
digit = len(N)
MOD = 10**9+7
lis = [1]*(digit+1)
for i in range(1,digit+1):
  lis[i] = lis[i-1]*45%MOD
ans = 0
cum = 1
for i in range(digit):
  ans += cum*N[i]*(N[i]-1)//2*lis[digit-(i+1)]
  if i>0: ans += lis[digit-i]
  ans %= MOD
  cum *= N[i]
  cum %= MOD
ans += cum
print(ans%MOD)
0