結果

問題 No.1343 Dividing Digit
ユーザー NoaSaber
提出日時 2021-04-24 08:55:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 80,384 KB
最終ジャッジ日時 2024-07-04 09:01:08
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
tmp=1
sum_n=0
sum_b=sum(A)
for i in A[::-1]:
    sum_n+=tmp*i%sum_b
    tmp*=K
    tmp%=sum_b
    sum_n%=sum_b
print(sum_n%sum_b)
0