結果

問題 No.5 数字のブロック
ユーザー boya978boya978
提出日時 2020-01-29 06:05:40
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 6,203 ms
コンパイル使用メモリ 101,840 KB
実行使用メモリ 24,236 KB
最終ジャッジ日時 2023-10-13 21:07:39
合計ジャッジ時間 10,578 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,708 KB
testcase_01 AC 62 ms
23,644 KB
testcase_02 WA -
testcase_03 AC 71 ms
20,104 KB
testcase_04 AC 71 ms
21,988 KB
testcase_05 AC 73 ms
24,104 KB
testcase_06 AC 73 ms
24,128 KB
testcase_07 AC 73 ms
22,056 KB
testcase_08 AC 73 ms
21,976 KB
testcase_09 AC 72 ms
21,852 KB
testcase_10 AC 74 ms
22,212 KB
testcase_11 AC 72 ms
21,976 KB
testcase_12 AC 74 ms
24,212 KB
testcase_13 AC 74 ms
24,196 KB
testcase_14 AC 62 ms
19,592 KB
testcase_15 AC 69 ms
21,916 KB
testcase_16 AC 74 ms
24,192 KB
testcase_17 AC 74 ms
20,216 KB
testcase_18 AC 75 ms
24,236 KB
testcase_19 AC 73 ms
22,308 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 63 ms
21,680 KB
testcase_24 AC 69 ms
21,712 KB
testcase_25 AC 69 ms
19,768 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 70 ms
22,044 KB
testcase_30 AC 70 ms
23,940 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 Hello{
    public static void Main(){

        int l = int.Parse(Console.ReadLine());
        Console.ReadLine();
        var w = Console.ReadLine().Split().Select(int.Parse).ToArray();  		//using System.Linq;
        
        Array.Sort(w);
        int sum=0;
        int ans=0;
        
        for(int i=0;i<w.Length;i++){
            sum += w[i];
            
            if(sum>l)
            {
                ans=i; break;
            }
        }
        
        Console.WriteLine(ans);

    }
}
0