結果

問題 No.1343 Dividing Digit
ユーザー kozykozy
提出日時 2021-01-16 13:02:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 152 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 19,588 KB
最終ジャッジ日時 2023-08-18 09:03:03
合計ジャッジ時間 4,416 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,800 KB
testcase_01 AC 17 ms
7,828 KB
testcase_02 AC 17 ms
7,916 KB
testcase_03 AC 239 ms
18,716 KB
testcase_04 AC 34 ms
9,144 KB
testcase_05 AC 72 ms
11,092 KB
testcase_06 AC 54 ms
9,876 KB
testcase_07 AC 99 ms
12,396 KB
testcase_08 AC 193 ms
16,508 KB
testcase_09 AC 217 ms
17,420 KB
testcase_10 AC 43 ms
9,540 KB
testcase_11 AC 92 ms
11,552 KB
testcase_12 AC 178 ms
15,496 KB
testcase_13 AC 162 ms
15,340 KB
testcase_14 AC 40 ms
9,300 KB
testcase_15 AC 84 ms
11,276 KB
testcase_16 AC 43 ms
9,384 KB
testcase_17 AC 215 ms
17,524 KB
testcase_18 AC 239 ms
18,620 KB
testcase_19 AC 163 ms
15,120 KB
testcase_20 AC 117 ms
12,628 KB
testcase_21 AC 208 ms
16,896 KB
testcase_22 AC 210 ms
16,844 KB
testcase_23 AC 255 ms
19,588 KB
testcase_24 AC 190 ms
9,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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