結果

問題 No.1343 Dividing Digit
ユーザー Kite_kumaKite_kuma
提出日時 2021-01-16 13:09:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 90,144 KB
最終ジャッジ日時 2023-08-18 09:16:53
合計ジャッジ時間 3,472 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,196 KB
testcase_01 AC 67 ms
71,428 KB
testcase_02 AC 68 ms
71,440 KB
testcase_03 AC 88 ms
89,896 KB
testcase_04 AC 74 ms
76,792 KB
testcase_05 AC 76 ms
78,232 KB
testcase_06 AC 74 ms
77,080 KB
testcase_07 AC 80 ms
80,284 KB
testcase_08 AC 87 ms
86,848 KB
testcase_09 AC 88 ms
88,316 KB
testcase_10 AC 73 ms
76,904 KB
testcase_11 AC 77 ms
79,856 KB
testcase_12 AC 82 ms
85,176 KB
testcase_13 AC 83 ms
84,236 KB
testcase_14 AC 75 ms
76,824 KB
testcase_15 AC 77 ms
79,344 KB
testcase_16 AC 73 ms
76,520 KB
testcase_17 AC 87 ms
88,320 KB
testcase_18 AC 91 ms
90,144 KB
testcase_19 AC 80 ms
84,048 KB
testcase_20 AC 77 ms
82,064 KB
testcase_21 AC 85 ms
86,732 KB
testcase_22 AC 90 ms
88,076 KB
testcase_23 AC 90 ms
89,996 KB
testcase_24 AC 86 ms
89,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = sum(a)

ans = 0
pw = 1

for c in reversed(a):
    ans += pw * c % mod
    pw *= k
    pw %= mod
print(ans % mod)    
0