結果

問題 No.1343 Dividing Digit
ユーザー dangodango
提出日時 2023-06-25 15:00:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 89,868 KB
最終ジャッジ日時 2023-09-15 09:21:04
合計ジャッジ時間 4,278 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,192 KB
testcase_01 AC 73 ms
71,132 KB
testcase_02 AC 72 ms
71,140 KB
testcase_03 AC 132 ms
89,852 KB
testcase_04 AC 83 ms
76,392 KB
testcase_05 AC 91 ms
78,136 KB
testcase_06 AC 84 ms
76,824 KB
testcase_07 AC 98 ms
80,152 KB
testcase_08 AC 119 ms
86,596 KB
testcase_09 AC 128 ms
88,116 KB
testcase_10 AC 85 ms
76,620 KB
testcase_11 AC 95 ms
79,464 KB
testcase_12 AC 114 ms
85,032 KB
testcase_13 AC 111 ms
83,864 KB
testcase_14 AC 84 ms
76,428 KB
testcase_15 AC 93 ms
79,144 KB
testcase_16 AC 84 ms
76,592 KB
testcase_17 AC 125 ms
88,160 KB
testcase_18 AC 131 ms
89,664 KB
testcase_19 AC 114 ms
84,012 KB
testcase_20 AC 102 ms
81,472 KB
testcase_21 AC 122 ms
86,528 KB
testcase_22 AC 126 ms
87,816 KB
testcase_23 AC 135 ms
89,868 KB
testcase_24 AC 130 ms
89,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
ans = 0
for i in range(N):
    ans += A[N - i - 1] * pow(K, i, S)
    ans %= S
print(ans)
0