結果

問題 No.2424 Josouzai
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-08-21 04:50:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 11,420 KB
実行使用メモリ 31,728 KB
最終ジャッジ日時 2023-08-21 04:50:29
合計ジャッジ時間 10,183 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,216 KB
testcase_01 AC 77 ms
15,288 KB
testcase_02 AC 77 ms
15,136 KB
testcase_03 AC 77 ms
15,096 KB
testcase_04 AC 113 ms
19,960 KB
testcase_05 AC 206 ms
31,688 KB
testcase_06 AC 191 ms
31,456 KB
testcase_07 AC 192 ms
31,416 KB
testcase_08 AC 194 ms
31,728 KB
testcase_09 AC 77 ms
15,196 KB
testcase_10 AC 104 ms
19,816 KB
testcase_11 AC 159 ms
29,444 KB
testcase_12 AC 159 ms
25,700 KB
testcase_13 AC 112 ms
20,012 KB
testcase_14 AC 145 ms
24,152 KB
testcase_15 AC 87 ms
16,040 KB
testcase_16 AC 180 ms
29,664 KB
testcase_17 AC 104 ms
18,712 KB
testcase_18 AC 110 ms
19,596 KB
testcase_19 AC 137 ms
22,944 KB
testcase_20 AC 193 ms
29,504 KB
testcase_21 AC 159 ms
26,368 KB
testcase_22 AC 114 ms
19,924 KB
testcase_23 AC 120 ms
20,956 KB
testcase_24 AC 98 ms
17,780 KB
testcase_25 AC 189 ms
30,252 KB
testcase_26 AC 163 ms
26,312 KB
testcase_27 AC 197 ms
31,040 KB
testcase_28 AC 179 ms
28,552 KB
testcase_29 AC 169 ms
27,408 KB
testcase_30 AC 100 ms
17,808 KB
testcase_31 AC 128 ms
21,984 KB
testcase_32 AC 191 ms
30,764 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k=gets.split(" ").map{|e| e.to_i}
xs=gets.split(" ").map{|e| e.to_i}.sort
ans=0
n.times{|i|
	break if k-xs[i]<0
	k-=xs[i]
	ans=i+1
}
puts [ans,k].join(" ")
0