結果

問題 No.1343 Dividing Digit
ユーザー nohakai3nohakai3
提出日時 2022-07-12 15:21:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 19,576 KB
最終ジャッジ日時 2023-09-05 17:27:03
合計ジャッジ時間 2,490 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,752 KB
testcase_01 AC 16 ms
7,884 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 84 ms
18,760 KB
testcase_04 AC 22 ms
9,032 KB
testcase_05 AC 34 ms
11,040 KB
testcase_06 AC 28 ms
9,896 KB
testcase_07 AC 43 ms
12,224 KB
testcase_08 AC 72 ms
16,416 KB
testcase_09 AC 84 ms
17,496 KB
testcase_10 AC 25 ms
9,408 KB
testcase_11 AC 40 ms
11,484 KB
testcase_12 AC 65 ms
15,664 KB
testcase_13 AC 62 ms
15,328 KB
testcase_14 AC 24 ms
9,380 KB
testcase_15 AC 37 ms
11,340 KB
testcase_16 AC 25 ms
9,320 KB
testcase_17 AC 76 ms
17,392 KB
testcase_18 AC 83 ms
18,752 KB
testcase_19 AC 63 ms
15,148 KB
testcase_20 AC 47 ms
12,772 KB
testcase_21 AC 74 ms
16,924 KB
testcase_22 AC 75 ms
16,948 KB
testcase_23 AC 90 ms
19,576 KB
testcase_24 AC 68 ms
9,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

P = sum(A)
beki = 1
ans = 0
for a in A[::-1]:
    ans = (ans + beki * a)%P
    beki = (beki*K)%P
print(ans)
0