結果

問題 No.1343 Dividing Digit
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-01-16 14:49:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 175 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 19,740 KB
最終ジャッジ日時 2023-08-18 12:02:18
合計ジャッジ時間 4,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,764 KB
testcase_01 AC 15 ms
7,828 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 245 ms
18,724 KB
testcase_04 AC 34 ms
9,040 KB
testcase_05 AC 75 ms
10,968 KB
testcase_06 AC 51 ms
9,768 KB
testcase_07 AC 96 ms
12,244 KB
testcase_08 AC 197 ms
16,460 KB
testcase_09 AC 224 ms
17,416 KB
testcase_10 AC 44 ms
9,408 KB
testcase_11 AC 90 ms
11,492 KB
testcase_12 AC 177 ms
15,528 KB
testcase_13 AC 160 ms
15,240 KB
testcase_14 AC 41 ms
9,292 KB
testcase_15 AC 85 ms
11,248 KB
testcase_16 AC 44 ms
9,416 KB
testcase_17 AC 214 ms
17,408 KB
testcase_18 AC 242 ms
18,580 KB
testcase_19 AC 166 ms
15,056 KB
testcase_20 AC 118 ms
12,708 KB
testcase_21 AC 209 ms
16,920 KB
testcase_22 AC 208 ms
16,928 KB
testcase_23 AC 252 ms
19,740 KB
testcase_24 AC 194 ms
10,012 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 += pow(k, n - i - 1, mod) * a[i]
    ans %= mod
print(ans)
0