結果

問題 No.1343 Dividing Digit
ユーザー MitarushiMitarushi
提出日時 2021-01-16 13:17:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 73,344 KB
最終ジャッジ日時 2024-11-27 13:31:01
合計ジャッジ時間 2,781 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,712 KB
testcase_01 AC 35 ms
52,096 KB
testcase_02 AC 34 ms
51,712 KB
testcase_03 AC 88 ms
72,832 KB
testcase_04 AC 44 ms
60,032 KB
testcase_05 AC 50 ms
62,848 KB
testcase_06 AC 48 ms
61,184 KB
testcase_07 AC 57 ms
64,384 KB
testcase_08 AC 80 ms
70,144 KB
testcase_09 AC 85 ms
71,040 KB
testcase_10 AC 46 ms
61,056 KB
testcase_11 AC 57 ms
63,744 KB
testcase_12 AC 72 ms
69,120 KB
testcase_13 AC 72 ms
67,840 KB
testcase_14 AC 47 ms
60,288 KB
testcase_15 AC 54 ms
63,360 KB
testcase_16 AC 46 ms
60,928 KB
testcase_17 AC 81 ms
71,552 KB
testcase_18 AC 87 ms
72,576 KB
testcase_19 AC 71 ms
67,840 KB
testcase_20 AC 64 ms
65,536 KB
testcase_21 AC 80 ms
70,528 KB
testcase_22 AC 80 ms
70,936 KB
testcase_23 AC 94 ms
73,344 KB
testcase_24 AC 89 ms
70,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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