結果

問題 No.5 数字のブロック
ユーザー the10hoursthe10hours
提出日時 2015-06-08 09:12:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 446 bytes
コンパイル時間 872 ms
コンパイル使用メモリ 113,824 KB
実行使用メモリ 28,096 KB
最終ジャッジ日時 2024-04-29 00:57:59
合計ジャッジ時間 3,048 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
27,212 KB
testcase_01 AC 31 ms
23,340 KB
testcase_02 AC 30 ms
23,096 KB
testcase_03 AC 40 ms
25,944 KB
testcase_04 AC 39 ms
27,732 KB
testcase_05 AC 41 ms
26,164 KB
testcase_06 AC 40 ms
25,864 KB
testcase_07 AC 39 ms
23,988 KB
testcase_08 AC 40 ms
25,760 KB
testcase_09 AC 38 ms
25,772 KB
testcase_10 AC 41 ms
26,336 KB
testcase_11 AC 38 ms
25,696 KB
testcase_12 AC 40 ms
28,096 KB
testcase_13 AC 41 ms
26,160 KB
testcase_14 AC 32 ms
25,136 KB
testcase_15 AC 35 ms
23,728 KB
testcase_16 AC 41 ms
25,944 KB
testcase_17 AC 43 ms
25,992 KB
testcase_18 AC 42 ms
24,244 KB
testcase_19 AC 43 ms
26,292 KB
testcase_20 AC 30 ms
25,092 KB
testcase_21 AC 31 ms
27,216 KB
testcase_22 AC 30 ms
22,964 KB
testcase_23 AC 31 ms
25,304 KB
testcase_24 AC 35 ms
25,300 KB
testcase_25 AC 37 ms
27,596 KB
testcase_26 AC 31 ms
25,232 KB
testcase_27 AC 31 ms
27,268 KB
testcase_28 AC 30 ms
27,104 KB
testcase_29 AC 38 ms
25,688 KB
testcase_30 AC 37 ms
25,720 KB
testcase_31 AC 30 ms
23,096 KB
testcase_32 AC 30 ms
24,792 KB
testcase_33 AC 31 ms
25,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class blockinthebox
{
static void Main()
{
int sum = 0,count = 0;
int L = int.Parse(Console.ReadLine());
int N = int.Parse(Console.ReadLine());
string[] str = Console.ReadLine().Split(' ');
int[] W = new int[N];

for(int i=0;i < N;i++)
{
W[i] = int.Parse(str[i]);
}

var Wsize = from ws in W
orderby ws
select ws;

foreach(var z in Wsize)
{
if(sum + z <= L)
{
sum += z;
count++;
}
}
Console.WriteLine(count);
}
}
0