結果

問題 No.1343 Dividing Digit
ユーザー kozykozy
提出日時 2021-01-16 13:02:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 283 ms / 2,000 ms
コード長 152 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,584 KB
最終ジャッジ日時 2024-05-05 14:48:31
合計ジャッジ時間 4,563 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,624 KB
testcase_01 AC 26 ms
10,624 KB
testcase_02 AC 27 ms
10,624 KB
testcase_03 AC 272 ms
19,936 KB
testcase_04 AC 47 ms
11,520 KB
testcase_05 AC 88 ms
13,184 KB
testcase_06 AC 64 ms
12,160 KB
testcase_07 AC 113 ms
14,304 KB
testcase_08 AC 218 ms
17,972 KB
testcase_09 AC 245 ms
18,792 KB
testcase_10 AC 56 ms
11,904 KB
testcase_11 AC 112 ms
13,568 KB
testcase_12 AC 205 ms
17,276 KB
testcase_13 AC 187 ms
16,736 KB
testcase_14 AC 52 ms
11,904 KB
testcase_15 AC 96 ms
13,440 KB
testcase_16 AC 56 ms
11,904 KB
testcase_17 AC 237 ms
18,908 KB
testcase_18 AC 270 ms
19,976 KB
testcase_19 AC 184 ms
17,056 KB
testcase_20 AC 140 ms
14,844 KB
testcase_21 AC 227 ms
18,340 KB
testcase_22 AC 237 ms
18,256 KB
testcase_23 AC 283 ms
20,584 KB
testcase_24 AC 220 ms
12,604 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)
    ans%=mod
print(ans)
0