結果

問題 No.1343 Dividing Digit
ユーザー hir355hir355
提出日時 2021-01-16 13:08:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 79,488 KB
最終ジャッジ日時 2024-05-05 14:59:12
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 38 ms
51,712 KB
testcase_02 AC 38 ms
51,712 KB
testcase_03 AC 61 ms
78,848 KB
testcase_04 AC 45 ms
60,672 KB
testcase_05 AC 49 ms
64,256 KB
testcase_06 AC 45 ms
62,208 KB
testcase_07 AC 50 ms
66,688 KB
testcase_08 AC 61 ms
74,752 KB
testcase_09 AC 60 ms
76,672 KB
testcase_10 AC 44 ms
61,440 KB
testcase_11 AC 49 ms
65,664 KB
testcase_12 AC 56 ms
72,832 KB
testcase_13 AC 56 ms
71,680 KB
testcase_14 AC 47 ms
61,184 KB
testcase_15 AC 52 ms
65,280 KB
testcase_16 AC 48 ms
61,568 KB
testcase_17 AC 62 ms
76,800 KB
testcase_18 AC 64 ms
78,848 KB
testcase_19 AC 55 ms
71,296 KB
testcase_20 AC 52 ms
68,480 KB
testcase_21 AC 60 ms
74,752 KB
testcase_22 AC 62 ms
76,288 KB
testcase_23 AC 64 ms
79,488 KB
testcase_24 AC 59 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
a.reverse()
t = 1
ans = 0
for x in a:
    ans += t * x
    t = t * k % s
print(ans % s)
0