結果

問題 No.1343 Dividing Digit
ユーザー 👑 rin204rin204
提出日時 2021-08-23 06:10:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 80,512 KB
最終ジャッジ日時 2024-04-24 21:19:25
合計ジャッジ時間 3,291 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,712 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 42 ms
51,712 KB
testcase_03 AC 71 ms
80,000 KB
testcase_04 AC 50 ms
61,056 KB
testcase_05 AC 55 ms
64,896 KB
testcase_06 AC 54 ms
62,720 KB
testcase_07 AC 57 ms
67,072 KB
testcase_08 AC 65 ms
75,648 KB
testcase_09 AC 69 ms
77,568 KB
testcase_10 AC 51 ms
61,952 KB
testcase_11 AC 56 ms
66,304 KB
testcase_12 AC 64 ms
73,856 KB
testcase_13 AC 62 ms
72,192 KB
testcase_14 AC 52 ms
61,824 KB
testcase_15 AC 55 ms
65,664 KB
testcase_16 AC 51 ms
61,952 KB
testcase_17 AC 69 ms
77,696 KB
testcase_18 AC 71 ms
79,616 KB
testcase_19 AC 61 ms
72,320 KB
testcase_20 AC 57 ms
68,992 KB
testcase_21 AC 67 ms
75,904 KB
testcase_22 AC 67 ms
77,184 KB
testcase_23 AC 71 ms
80,512 KB
testcase_24 AC 68 ms
78,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
alst = list(map(int, input().split()))
MOD = sum(alst)
ans = 0
times = 1
for a in alst[::-1]:
    ans += a * times
    ans %= MOD
    times *= k
    times %= MOD
print(ans)
0