結果

問題 No.1343 Dividing Digit
ユーザー titiatitia
提出日時 2021-01-16 13:05:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,328 KB
最終ジャッジ日時 2024-05-05 14:53:19
合計ジャッジ時間 4,599 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,496 KB
testcase_01 AC 27 ms
10,496 KB
testcase_02 AC 27 ms
10,624 KB
testcase_03 AC 268 ms
19,292 KB
testcase_04 AC 46 ms
11,520 KB
testcase_05 AC 87 ms
13,312 KB
testcase_06 AC 64 ms
12,160 KB
testcase_07 AC 114 ms
14,052 KB
testcase_08 AC 214 ms
18,016 KB
testcase_09 AC 242 ms
18,404 KB
testcase_10 AC 57 ms
11,904 KB
testcase_11 AC 108 ms
13,696 KB
testcase_12 AC 198 ms
17,116 KB
testcase_13 AC 178 ms
16,772 KB
testcase_14 AC 51 ms
11,776 KB
testcase_15 AC 95 ms
13,440 KB
testcase_16 AC 53 ms
11,904 KB
testcase_17 AC 232 ms
18,300 KB
testcase_18 AC 281 ms
19,080 KB
testcase_19 AC 191 ms
16,932 KB
testcase_20 AC 135 ms
14,848 KB
testcase_21 AC 226 ms
18,264 KB
testcase_22 AC 239 ms
18,296 KB
testcase_23 AC 277 ms
20,328 KB
testcase_24 AC 235 ms
12,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

S=sum(A)

X=0
for i in range(N):
    X=(X+A[N-1-i]*pow(K,i,S))%S

print(X)
0