結果

問題 No.1343 Dividing Digit
ユーザー 小野寺健小野寺健
提出日時 2021-05-25 10:37:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 165 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,540 KB
最終ジャッジ日時 2024-04-21 20:10:41
合計ジャッジ時間 2,728 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,624 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 25 ms
10,624 KB
testcase_03 AC 97 ms
20,064 KB
testcase_04 AC 33 ms
11,392 KB
testcase_05 AC 47 ms
13,312 KB
testcase_06 AC 39 ms
12,288 KB
testcase_07 AC 54 ms
14,304 KB
testcase_08 AC 84 ms
17,972 KB
testcase_09 AC 95 ms
18,920 KB
testcase_10 AC 37 ms
12,032 KB
testcase_11 AC 50 ms
13,824 KB
testcase_12 AC 75 ms
17,168 KB
testcase_13 AC 72 ms
16,864 KB
testcase_14 AC 34 ms
11,776 KB
testcase_15 AC 50 ms
13,440 KB
testcase_16 AC 34 ms
11,904 KB
testcase_17 AC 87 ms
18,844 KB
testcase_18 AC 101 ms
19,976 KB
testcase_19 AC 75 ms
16,924 KB
testcase_20 AC 60 ms
14,804 KB
testcase_21 AC 88 ms
18,212 KB
testcase_22 AC 88 ms
18,256 KB
testcase_23 AC 100 ms
20,540 KB
testcase_24 AC 80 ms
12,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))

S = sum(A)
k = 1
T = 0
for a in A[::-1]:
    T = (T + a * k) % S
    k = k * K % S
print(T % S)
0