結果

問題 No.1580 I like Logarithm!
ユーザー hir355hir355
提出日時 2021-07-02 21:45:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2023-09-11 21:36:08
合計ジャッジ時間 6,839 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 72 ms
71,272 KB
testcase_02 AC 74 ms
71,508 KB
testcase_03 AC 73 ms
71,608 KB
testcase_04 AC 74 ms
71,272 KB
testcase_05 AC 72 ms
71,140 KB
testcase_06 AC 95 ms
76,240 KB
testcase_07 AC 119 ms
75,924 KB
testcase_08 AC 75 ms
71,360 KB
testcase_09 AC 81 ms
75,964 KB
testcase_10 AC 83 ms
76,028 KB
testcase_11 AC 103 ms
76,144 KB
testcase_12 AC 104 ms
75,964 KB
testcase_13 AC 99 ms
75,936 KB
testcase_14 AC 119 ms
75,732 KB
testcase_15 AC 109 ms
76,000 KB
testcase_16 AC 73 ms
71,260 KB
testcase_17 AC 73 ms
71,364 KB
testcase_18 AC 74 ms
71,240 KB
testcase_19 AC 73 ms
71,152 KB
testcase_20 AC 72 ms
71,136 KB
testcase_21 AC 74 ms
71,152 KB
testcase_22 AC 74 ms
71,136 KB
testcase_23 AC 73 ms
71,388 KB
testcase_24 AC 74 ms
71,348 KB
testcase_25 AC 74 ms
71,252 KB
testcase_26 AC 124 ms
76,068 KB
testcase_27 AC 122 ms
76,048 KB
testcase_28 AC 123 ms
76,168 KB
testcase_29 AC 122 ms
75,932 KB
testcase_30 AC 124 ms
76,148 KB
testcase_31 AC 123 ms
75,948 KB
testcase_32 AC 120 ms
76,140 KB
testcase_33 AC 123 ms
75,888 KB
testcase_34 AC 124 ms
76,076 KB
testcase_35 AC 122 ms
76,288 KB
testcase_36 AC 119 ms
76,072 KB
testcase_37 AC 119 ms
76,136 KB
testcase_38 AC 118 ms
76,004 KB
testcase_39 AC 122 ms
76,072 KB
testcase_40 AC 121 ms
75,940 KB
testcase_41 AC 121 ms
76,076 KB
testcase_42 AC 122 ms
76,148 KB
testcase_43 AC 122 ms
75,960 KB
testcase_44 AC 123 ms
76,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
a = int(input())
b = input()
x = 0
for c in b:
    x *= a
    x += ord(c) - ord('0')
    x %= MOD
ans = (x - (pow(a, len(b) - 1, MOD) - 1)) * (len(b) - 1)
for i in range(len(b) - 1):
    ans += i * pow(a, i, MOD) * (a - 1)
print(ans % MOD)
0