結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
KoD
|
| 提出日時 | 2021-01-15 16:29:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 124 ms / 2,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 806 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 20,420 KB |
| 最終ジャッジ日時 | 2024-11-26 06:59:11 |
| 合計ジャッジ時間 | 3,166 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
N, K = map(int, input().split())
assert(1 <= N and N <= 100000)
assert(2 <= K and K <= 10000)
A = list(map(int, input().split()))
A.reverse()
assert(len(A) == N)
assert(A[N - 1] != 0)
mod = sum(A)
digit = 1
ans = 0
for x in A:
assert(0 <= x and x < K)
ans += digit * x
ans %= mod
digit *= K
digit %= mod
print(ans)
KoD