結果

問題 No.5 数字のブロック
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-26 17:59:09
言語 Java21
(openjdk 21)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 337 bytes
コンパイル時間 1,952 ms
コンパイル使用メモリ 72,096 KB
実行使用メモリ 61,408 KB
最終ジャッジ日時 2023-09-06 05:06:44
合計ジャッジ時間 9,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,840 KB
testcase_01 AC 119 ms
56,404 KB
testcase_02 AC 121 ms
55,816 KB
testcase_03 AC 235 ms
60,776 KB
testcase_04 AC 217 ms
59,624 KB
testcase_05 AC 250 ms
60,292 KB
testcase_06 AC 223 ms
59,668 KB
testcase_07 AC 220 ms
59,424 KB
testcase_08 AC 238 ms
60,088 KB
testcase_09 AC 202 ms
59,632 KB
testcase_10 AC 245 ms
60,456 KB
testcase_11 AC 225 ms
59,640 KB
testcase_12 AC 248 ms
59,980 KB
testcase_13 AC 265 ms
60,568 KB
testcase_14 AC 134 ms
56,296 KB
testcase_15 AC 170 ms
56,924 KB
testcase_16 AC 246 ms
60,284 KB
testcase_17 AC 266 ms
60,544 KB
testcase_18 AC 263 ms
60,508 KB
testcase_19 AC 268 ms
61,408 KB
testcase_20 RE -
testcase_21 AC 122 ms
56,440 KB
testcase_22 AC 123 ms
56,292 KB
testcase_23 AC 123 ms
56,340 KB
testcase_24 AC 159 ms
56,404 KB
testcase_25 AC 177 ms
56,460 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 215 ms
59,140 KB
testcase_30 AC 196 ms
58,732 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;


public class Main {
	public static void main(String[] a) {
		Scanner s=new Scanner(System.in);
		int L=s.nextInt(),N=s.nextInt(),i=0,Z=0;
		int[] B=new int[N];
		while(s.hasNext())B[i++]=s.nextInt();
		Arrays.sort(B);
		for(i=0;L>(Z+=B[i++]););
		System.out.println(i-(Z>L?1:0));
	}
}
0