提出 #72529452


ソースコード 拡げる

n0,n1,n2=map(int,input().split(' '))
nn=sorted(list(map(int,input().split(' '))))
for i in range(n0-n1):
  nn.pop()
f,t=0,0
for i in range(len(nn)):
  t+=nn[-i-1]
  if t>=n2:
    f=1
    break
print(i+1+n0-n1 if f>0 else -1)

提出情報

提出日時
問題 C - Sake or Water
ユーザ bscdesu
言語 Python (CPython 3.13.7)
得点 300
コード長 234 Byte
結果 AC
実行時間 136 ms
メモリ 43080 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 33
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 9 ms 9300 KiB
example_01.txt AC 9 ms 9300 KiB
example_02.txt AC 9 ms 9128 KiB
hand_00.txt AC 69 ms 43080 KiB
hand_01.txt AC 47 ms 42948 KiB
hand_02.txt AC 114 ms 41160 KiB
hand_03.txt AC 117 ms 41284 KiB
hand_04.txt AC 106 ms 41120 KiB
hand_05.txt AC 106 ms 41224 KiB
hand_06.txt AC 104 ms 41288 KiB
hand_07.txt AC 10 ms 9300 KiB
hand_08.txt AC 9 ms 9368 KiB
hand_09.txt AC 9 ms 9148 KiB
hand_10.txt AC 9 ms 9292 KiB
hand_11.txt AC 71 ms 42956 KiB
random_00.txt AC 103 ms 41976 KiB
random_01.txt AC 102 ms 42028 KiB
random_02.txt AC 103 ms 41852 KiB
random_03.txt AC 104 ms 42016 KiB
random_04.txt AC 104 ms 41900 KiB
random_05.txt AC 104 ms 42060 KiB
random_06.txt AC 96 ms 41968 KiB
random_07.txt AC 102 ms 42020 KiB
random_08.txt AC 114 ms 42140 KiB
random_09.txt AC 115 ms 42016 KiB
random_10.txt AC 111 ms 42000 KiB
random_11.txt AC 102 ms 42652 KiB
random_12.txt AC 88 ms 42520 KiB
random_13.txt AC 100 ms 42624 KiB
random_14.txt AC 132 ms 42032 KiB
random_15.txt AC 136 ms 42060 KiB
random_16.txt AC 95 ms 42624 KiB
random_17.txt AC 119 ms 42520 KiB