結果
| 問題 | No.1343 Dividing Digit | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-04-24 08:53:19 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 176 bytes | 
| コンパイル時間 | 197 ms | 
| コンパイル使用メモリ | 82,356 KB | 
| 実行使用メモリ | 96,992 KB | 
| 最終ジャッジ日時 | 2024-07-04 09:01:05 | 
| 合計ジャッジ時間 | 3,892 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | TLE * 1 -- * 21 | 
ソースコード
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
    sum_n%=sum_b
print(sum_n%sum_b)
            
            
            
        