結果

問題 No.1343 Dividing Digit
ユーザー kyo1kyo1
提出日時 2021-01-21 06:15:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 187 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,504 KB
実行使用メモリ 19,724 KB
最終ジャッジ日時 2023-08-25 18:13:02
合計ジャッジ時間 4,558 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,840 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 245 ms
18,732 KB
testcase_04 AC 34 ms
9,036 KB
testcase_05 AC 73 ms
11,000 KB
testcase_06 AC 50 ms
9,852 KB
testcase_07 AC 97 ms
12,216 KB
testcase_08 AC 199 ms
16,588 KB
testcase_09 AC 219 ms
17,524 KB
testcase_10 AC 44 ms
9,556 KB
testcase_11 AC 93 ms
11,484 KB
testcase_12 AC 180 ms
15,676 KB
testcase_13 AC 164 ms
15,332 KB
testcase_14 AC 40 ms
9,372 KB
testcase_15 AC 82 ms
11,280 KB
testcase_16 AC 41 ms
9,644 KB
testcase_17 AC 217 ms
17,392 KB
testcase_18 AC 240 ms
18,780 KB
testcase_19 AC 164 ms
15,172 KB
testcase_20 AC 118 ms
12,720 KB
testcase_21 AC 204 ms
17,076 KB
testcase_22 AC 208 ms
16,960 KB
testcase_23 AC 253 ms
19,724 KB
testcase_24 AC 199 ms
10,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))[::-1]

mod = sum(A)

res = 0
for i, a in enumerate(A):
    res += a * pow(K, i, mod) % mod
    res %= mod

print(res)
0