結果

問題 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  
実行時間 210 ms / 2,000 ms
コード長 168 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 19,716 KB
最終ジャッジ日時 2023-08-18 09:12:05
合計ジャッジ時間 4,033 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,876 KB
testcase_01 AC 15 ms
7,816 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 200 ms
18,808 KB
testcase_04 AC 30 ms
9,192 KB
testcase_05 AC 62 ms
11,508 KB
testcase_06 AC 44 ms
10,216 KB
testcase_07 AC 83 ms
12,428 KB
testcase_08 AC 161 ms
16,640 KB
testcase_09 AC 183 ms
17,524 KB
testcase_10 AC 37 ms
9,868 KB
testcase_11 AC 77 ms
12,436 KB
testcase_12 AC 147 ms
15,664 KB
testcase_13 AC 135 ms
15,300 KB
testcase_14 AC 35 ms
9,476 KB
testcase_15 AC 69 ms
11,400 KB
testcase_16 AC 37 ms
9,892 KB
testcase_17 AC 177 ms
17,460 KB
testcase_18 AC 198 ms
18,608 KB
testcase_19 AC 135 ms
15,224 KB
testcase_20 AC 99 ms
12,696 KB
testcase_21 AC 170 ms
17,120 KB
testcase_22 AC 172 ms
17,024 KB
testcase_23 AC 210 ms
19,716 KB
testcase_24 AC 156 ms
11,132 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