結果

問題 No.5 数字のブロック
ユーザー PE11PE11
提出日時 2018-02-02 14:09:53
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 2,202 ms
コンパイル使用メモリ 103,956 KB
実行使用メモリ 26,216 KB
最終ジャッジ日時 2023-08-29 22:04:52
合計ジャッジ時間 6,283 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
21,928 KB
testcase_01 AC 65 ms
21,868 KB
testcase_02 AC 64 ms
23,964 KB
testcase_03 AC 76 ms
22,324 KB
testcase_04 AC 75 ms
22,416 KB
testcase_05 AC 78 ms
22,588 KB
testcase_06 AC 76 ms
22,492 KB
testcase_07 AC 77 ms
22,456 KB
testcase_08 AC 76 ms
22,328 KB
testcase_09 AC 75 ms
26,216 KB
testcase_10 AC 79 ms
22,528 KB
testcase_11 AC 76 ms
24,308 KB
testcase_12 AC 78 ms
22,272 KB
testcase_13 AC 77 ms
22,484 KB
testcase_14 AC 65 ms
21,984 KB
testcase_15 AC 71 ms
22,152 KB
testcase_16 AC 79 ms
22,456 KB
testcase_17 AC 79 ms
22,604 KB
testcase_18 AC 78 ms
22,592 KB
testcase_19 AC 79 ms
20,628 KB
testcase_20 WA -
testcase_21 AC 64 ms
21,948 KB
testcase_22 AC 67 ms
21,968 KB
testcase_23 AC 65 ms
23,908 KB
testcase_24 AC 72 ms
22,020 KB
testcase_25 AC 72 ms
22,168 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 77 ms
24,364 KB
testcase_30 AC 74 ms
22,320 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

public class Program
{
	static void Main()
	{
		var Width = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).First();
		Console.ReadLine();

		var BlockWidth = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).OrderBy(x => x).ToList<int>();

		for (int i = 0; i < BlockWidth.Count; i++)
		{
			Width -= BlockWidth[i];

			if(Width == 0)
			{
				Console.WriteLine(i + 1);
				break;
			}

			if(Width < 0)
			{
				Console.WriteLine(i);
				break;
			}
		}
	}
}



0