結果

問題 No.5 数字のブロック
ユーザー chankou0920chankou0920
提出日時 2017-10-01 15:09:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 3,087 ms
コンパイル使用メモリ 100,708 KB
実行使用メモリ 23,340 KB
最終ジャッジ日時 2023-08-11 17:51:03
合計ジャッジ時間 5,435 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,696 KB
testcase_01 AC 56 ms
20,688 KB
testcase_02 AC 56 ms
20,812 KB
testcase_03 AC 67 ms
21,076 KB
testcase_04 AC 67 ms
23,044 KB
testcase_05 AC 67 ms
21,076 KB
testcase_06 AC 68 ms
21,080 KB
testcase_07 AC 66 ms
21,024 KB
testcase_08 AC 68 ms
21,024 KB
testcase_09 AC 65 ms
22,920 KB
testcase_10 AC 67 ms
21,244 KB
testcase_11 AC 66 ms
23,084 KB
testcase_12 AC 66 ms
21,108 KB
testcase_13 AC 67 ms
21,172 KB
testcase_14 AC 57 ms
20,572 KB
testcase_15 AC 63 ms
18,712 KB
testcase_16 AC 69 ms
19,204 KB
testcase_17 AC 68 ms
21,220 KB
testcase_18 AC 69 ms
21,216 KB
testcase_19 AC 69 ms
23,340 KB
testcase_20 AC 57 ms
20,624 KB
testcase_21 AC 57 ms
20,704 KB
testcase_22 AC 57 ms
20,700 KB
testcase_23 AC 57 ms
20,712 KB
testcase_24 AC 64 ms
20,888 KB
testcase_25 AC 64 ms
20,848 KB
testcase_26 AC 55 ms
20,704 KB
testcase_27 AC 56 ms
20,688 KB
testcase_28 AC 57 ms
20,732 KB
testcase_29 AC 68 ms
20,948 KB
testcase_30 AC 65 ms
20,964 KB
testcase_31 AC 55 ms
22,648 KB
testcase_32 AC 55 ms
20,676 KB
testcase_33 AC 56 ms
22,692 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program {
	public static void Main(string[] args) {
		int l = int.Parse(Console.ReadLine());
		Console.ReadLine();
		string[] s = Console.ReadLine().Split(' ');
		int[] w = new int[s.Length];
		for (int i = 0; i < w.Length; i++) {
			w[i] = int.Parse(s[i]);
		}
		Array.Sort(w);
		int count = 0;
		for (int i = 0; i < w.Length; i++) {
			if (l - w[i] >= 0) {
				l -= w[i];
				count++;
			}
		}
		Console.WriteLine(count);
	}
}
0