結果

問題 No.5 数字のブロック
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-26 17:51:25
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 72,556 KB
実行使用メモリ 61,052 KB
最終ジャッジ日時 2023-09-06 05:06:31
合計ジャッジ時間 10,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,184 KB
testcase_01 AC 120 ms
55,812 KB
testcase_02 WA -
testcase_03 AC 237 ms
60,272 KB
testcase_04 AC 215 ms
59,400 KB
testcase_05 WA -
testcase_06 AC 226 ms
60,116 KB
testcase_07 AC 226 ms
59,888 KB
testcase_08 AC 236 ms
61,052 KB
testcase_09 AC 205 ms
59,044 KB
testcase_10 AC 249 ms
60,400 KB
testcase_11 AC 220 ms
59,924 KB
testcase_12 AC 236 ms
60,636 KB
testcase_13 AC 252 ms
60,120 KB
testcase_14 AC 134 ms
56,080 KB
testcase_15 WA -
testcase_16 AC 253 ms
60,480 KB
testcase_17 AC 261 ms
60,728 KB
testcase_18 AC 265 ms
60,112 KB
testcase_19 AC 257 ms
60,204 KB
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 124 ms
56,108 KB
testcase_24 AC 178 ms
56,856 KB
testcase_25 AC 180 ms
56,864 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
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-1);
	}
}
0