結果

問題 No.1343 Dividing Digit
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-24 13:26:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 149 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 19,596 KB
最終ジャッジ日時 2023-08-21 00:47:35
合計ジャッジ時間 4,349 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 15 ms
7,968 KB
testcase_02 AC 16 ms
7,876 KB
testcase_03 AC 224 ms
18,736 KB
testcase_04 AC 33 ms
9,060 KB
testcase_05 AC 69 ms
10,976 KB
testcase_06 AC 47 ms
9,876 KB
testcase_07 AC 89 ms
12,304 KB
testcase_08 AC 182 ms
16,624 KB
testcase_09 AC 203 ms
17,408 KB
testcase_10 AC 41 ms
9,496 KB
testcase_11 AC 85 ms
11,560 KB
testcase_12 AC 161 ms
15,636 KB
testcase_13 AC 149 ms
15,280 KB
testcase_14 AC 38 ms
9,480 KB
testcase_15 AC 78 ms
11,348 KB
testcase_16 AC 39 ms
9,516 KB
testcase_17 AC 197 ms
17,560 KB
testcase_18 AC 220 ms
18,688 KB
testcase_19 AC 153 ms
15,164 KB
testcase_20 AC 109 ms
12,740 KB
testcase_21 AC 194 ms
16,968 KB
testcase_22 AC 196 ms
16,928 KB
testcase_23 AC 236 ms
19,596 KB
testcase_24 AC 175 ms
9,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
a=a[::-1]
mod=sum(a)
num=0
for i in range(n):
    num+=a[i]*pow(k,i,mod)
print(num%mod)
0