結果

問題 No.5 数字のブロック
ユーザー k-a-rgbk-a-rgb
提出日時 2023-09-05 14:34:17
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 659 bytes
コンパイル時間 3,330 ms
コンパイル使用メモリ 105,908 KB
実行使用メモリ 24,596 KB
最終ジャッジ日時 2023-09-05 14:34:25
合計ジャッジ時間 7,322 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,804 KB
testcase_01 AC 63 ms
21,788 KB
testcase_02 RE -
testcase_03 AC 74 ms
22,364 KB
testcase_04 AC 72 ms
22,344 KB
testcase_05 AC 74 ms
22,372 KB
testcase_06 AC 74 ms
22,284 KB
testcase_07 AC 74 ms
22,368 KB
testcase_08 AC 73 ms
22,308 KB
testcase_09 AC 71 ms
22,236 KB
testcase_10 AC 75 ms
24,452 KB
testcase_11 AC 72 ms
24,372 KB
testcase_12 AC 72 ms
22,256 KB
testcase_13 AC 73 ms
22,344 KB
testcase_14 AC 62 ms
23,904 KB
testcase_15 AC 69 ms
22,080 KB
testcase_16 AC 72 ms
22,424 KB
testcase_17 AC 73 ms
22,620 KB
testcase_18 AC 75 ms
24,596 KB
testcase_19 AC 74 ms
22,560 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 60 ms
19,824 KB
testcase_24 AC 72 ms
19,992 KB
testcase_25 AC 70 ms
22,076 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 71 ms
20,164 KB
testcase_30 AC 70 ms
22,252 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Collections.Generic;
using System.Linq;

namespace PracticeAtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
			
			
			//ブロック
			string sA = Console.ReadLine();
			string sB = Console.ReadLine();
			string sC = Console.ReadLine();
			string[] sD = sC.Split(' ');
			
			int[] after = sD.Select(s => int.Parse(s)).ToArray();
			
			Array.Sort(after);
			int intSA = int.Parse(sA); 
			int i = 0;
			int sumA = 0;
			
			//While文に書き直して判断を行う
			while(sumA +  after[i] <= intSA){
				sumA = sumA +  after[i];
				i++;
				
			}	
			Console.WriteLine(i);
			
		}
    }
}
0