結果

問題 No.1007 コイン集め
ユーザー chinchillachinchilla
提出日時 2020-03-16 11:13:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 53 ms / 1,500 ms
コード長 169 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 19,028 KB
最終ジャッジ日時 2023-08-18 17:40:39
合計ジャッジ時間 2,827 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 AC 15 ms
7,820 KB
testcase_05 AC 15 ms
7,924 KB
testcase_06 AC 16 ms
7,812 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 16 ms
7,908 KB
testcase_09 AC 16 ms
7,912 KB
testcase_10 AC 15 ms
7,812 KB
testcase_11 AC 16 ms
7,816 KB
testcase_12 AC 51 ms
18,836 KB
testcase_13 AC 52 ms
18,876 KB
testcase_14 AC 51 ms
19,000 KB
testcase_15 AC 39 ms
10,412 KB
testcase_16 AC 38 ms
10,572 KB
testcase_17 AC 39 ms
10,592 KB
testcase_18 AC 52 ms
18,832 KB
testcase_19 AC 53 ms
18,996 KB
testcase_20 AC 52 ms
18,888 KB
testcase_21 AC 52 ms
19,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
n,k,*a=map(int,sys.stdin.read().split())
j=k-1
b=bytes(i>1 for i in a)
print(a[j]-sum(sorted([-sum(a[b.rfind(0,0,j)-n:j]),-sum(a[b.find(0,k):j:-1])])[:a[j]]))
0