結果

問題 No.1343 Dividing Digit
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-01-16 14:49:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 175 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,448 KB
最終ジャッジ日時 2024-05-05 17:24:36
合計ジャッジ時間 5,096 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,496 KB
testcase_01 AC 26 ms
10,624 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 282 ms
20,064 KB
testcase_04 AC 48 ms
11,392 KB
testcase_05 AC 96 ms
13,184 KB
testcase_06 AC 70 ms
12,288 KB
testcase_07 AC 121 ms
14,432 KB
testcase_08 AC 241 ms
17,976 KB
testcase_09 AC 261 ms
18,792 KB
testcase_10 AC 60 ms
12,032 KB
testcase_11 AC 111 ms
13,568 KB
testcase_12 AC 204 ms
17,024 KB
testcase_13 AC 190 ms
16,608 KB
testcase_14 AC 52 ms
11,648 KB
testcase_15 AC 100 ms
13,440 KB
testcase_16 AC 56 ms
12,032 KB
testcase_17 AC 249 ms
18,812 KB
testcase_18 AC 273 ms
19,720 KB
testcase_19 AC 191 ms
16,928 KB
testcase_20 AC 137 ms
14,592 KB
testcase_21 AC 239 ms
18,212 KB
testcase_22 AC 246 ms
18,388 KB
testcase_23 AC 285 ms
20,448 KB
testcase_24 AC 226 ms
12,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = sum(a)
ans = 0
for i in range(n):
    ans += pow(k, n - i - 1, mod) * a[i]
    ans %= mod
print(ans)
0