結果

問題 No.1343 Dividing Digit
ユーザー GER_chenGER_chen
提出日時 2021-01-16 13:06:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 264 ms / 2,000 ms
コード長 168 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,540 KB
最終ジャッジ日時 2024-05-05 14:56:31
合計ジャッジ時間 4,390 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 264 ms
20,064 KB
testcase_04 AC 46 ms
11,520 KB
testcase_05 AC 85 ms
13,496 KB
testcase_06 AC 63 ms
12,288 KB
testcase_07 AC 108 ms
14,540 KB
testcase_08 AC 202 ms
18,100 KB
testcase_09 AC 231 ms
18,920 KB
testcase_10 AC 53 ms
12,032 KB
testcase_11 AC 102 ms
14,336 KB
testcase_12 AC 189 ms
17,280 KB
testcase_13 AC 169 ms
16,860 KB
testcase_14 AC 51 ms
12,032 KB
testcase_15 AC 96 ms
14,080 KB
testcase_16 AC 53 ms
12,032 KB
testcase_17 AC 227 ms
18,944 KB
testcase_18 AC 255 ms
19,976 KB
testcase_19 AC 176 ms
17,060 KB
testcase_20 AC 132 ms
14,840 KB
testcase_21 AC 225 ms
18,340 KB
testcase_22 AC 220 ms
18,516 KB
testcase_23 AC 261 ms
20,540 KB
testcase_24 AC 205 ms
13,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki-1343
N, K = map(int, input().split())
A = list(map(int, input().split()))
b = sum(A)
a = sum([A[-i]*pow(K,i-1,b) for i in range(1,N+1)])
q, r = a//b, a%b
print(r)
0