結果

問題 No.5 数字のブロック
ユーザー NetSeedNetSeed
提出日時 2016-05-10 22:51:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 1,197 ms
コンパイル使用メモリ 115,340 KB
実行使用メモリ 29,752 KB
最終ジャッジ日時 2024-04-15 15:07:24
合計ジャッジ時間 3,387 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
19,456 KB
testcase_01 AC 36 ms
19,584 KB
testcase_02 WA -
testcase_03 AC 46 ms
20,736 KB
testcase_04 AC 45 ms
20,480 KB
testcase_05 AC 47 ms
20,864 KB
testcase_06 AC 45 ms
20,736 KB
testcase_07 AC 44 ms
20,480 KB
testcase_08 AC 46 ms
20,480 KB
testcase_09 AC 44 ms
20,096 KB
testcase_10 AC 47 ms
21,248 KB
testcase_11 AC 43 ms
20,608 KB
testcase_12 AC 46 ms
20,736 KB
testcase_13 AC 46 ms
20,992 KB
testcase_14 AC 36 ms
19,328 KB
testcase_15 AC 43 ms
19,840 KB
testcase_16 AC 47 ms
20,864 KB
testcase_17 AC 48 ms
21,120 KB
testcase_18 AC 48 ms
21,120 KB
testcase_19 AC 49 ms
21,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 35 ms
19,328 KB
testcase_24 AC 40 ms
19,840 KB
testcase_25 AC 41 ms
19,840 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 47 ms
20,736 KB
testcase_30 AC 46 ms
20,224 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;

namespace TestBench
{

	internal class Program
	{
		public static int Val { get; set; } = 100;

		internal static void Main()
		{
			var l = int.Parse(Console.ReadLine());
			Console.ReadLine();
			var w =
				Console.ReadLine()
					.Split(' ')
					.Select(x => short.Parse(x))
					.OrderBy(x => x)
					.Select((width, index) => new {width, index}).ToArray();

			var accum = 0;
			var idx = 0;
			foreach (var elem in w)
			{
				var tmp = accum + elem.width;
				idx = elem.index;

				if (tmp > l)
				{
					break;
				}

				accum = tmp;
			}


			Console.WriteLine(idx);




		}
	}
}
0