結果

問題 No.1343 Dividing Digit
ユーザー lloyzlloyz
提出日時 2022-11-14 00:09:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 89,984 KB
最終ジャッジ日時 2023-10-13 08:18:03
合計ジャッジ時間 5,116 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,352 KB
testcase_01 AC 71 ms
71,144 KB
testcase_02 AC 71 ms
71,408 KB
testcase_03 AC 125 ms
89,964 KB
testcase_04 AC 81 ms
76,896 KB
testcase_05 AC 90 ms
78,408 KB
testcase_06 AC 83 ms
77,072 KB
testcase_07 AC 97 ms
80,396 KB
testcase_08 AC 118 ms
86,952 KB
testcase_09 AC 125 ms
88,388 KB
testcase_10 AC 81 ms
76,484 KB
testcase_11 AC 95 ms
79,776 KB
testcase_12 AC 114 ms
85,396 KB
testcase_13 AC 110 ms
84,156 KB
testcase_14 AC 74 ms
76,656 KB
testcase_15 AC 85 ms
79,032 KB
testcase_16 AC 76 ms
76,560 KB
testcase_17 AC 110 ms
88,264 KB
testcase_18 AC 121 ms
89,748 KB
testcase_19 AC 102 ms
84,148 KB
testcase_20 AC 90 ms
81,740 KB
testcase_21 AC 109 ms
86,768 KB
testcase_22 AC 114 ms
88,156 KB
testcase_23 AC 127 ms
89,984 KB
testcase_24 AC 126 ms
89,428 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) % mod
    ans %= mod
print(ans)
0