結果

問題 No.5 数字のブロック
ユーザー k-a-rgbk-a-rgb
提出日時 2023-09-05 14:33:17
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 663 bytes
コンパイル時間 3,277 ms
コンパイル使用メモリ 102,148 KB
実行使用メモリ 24,608 KB
最終ジャッジ日時 2023-09-05 14:33:24
合計ジャッジ時間 6,769 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,764 KB
testcase_01 AC 64 ms
21,976 KB
testcase_02 RE -
testcase_03 AC 76 ms
24,400 KB
testcase_04 AC 74 ms
22,188 KB
testcase_05 AC 76 ms
22,416 KB
testcase_06 AC 75 ms
22,372 KB
testcase_07 AC 75 ms
22,284 KB
testcase_08 AC 75 ms
24,288 KB
testcase_09 AC 73 ms
22,124 KB
testcase_10 AC 78 ms
22,552 KB
testcase_11 AC 76 ms
24,316 KB
testcase_12 AC 75 ms
22,320 KB
testcase_13 AC 76 ms
22,364 KB
testcase_14 AC 66 ms
23,780 KB
testcase_15 AC 72 ms
22,000 KB
testcase_16 AC 76 ms
22,516 KB
testcase_17 AC 77 ms
22,480 KB
testcase_18 AC 77 ms
24,608 KB
testcase_19 AC 77 ms
22,712 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 64 ms
21,832 KB
testcase_24 AC 72 ms
22,076 KB
testcase_25 AC 72 ms
19,964 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 77 ms
24,260 KB
testcase_30 AC 75 ms
22,264 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