結果

問題 No.5 数字のブロック
ユーザー mtsu_friends
提出日時 2021-04-05 13:43:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 111,344 KB
実行使用メモリ 27,948 KB
最終ジャッジ日時 2024-12-30 22:59:30
合計ジャッジ時間 3,128 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Yuki5 {
	static void Main(string[] _) {
		var count  = 0;
		var length = int.Parse(Console.ReadLine());
		Console.ReadLine();
		var width = Console.ReadLine().Split().Select(int.Parse).ToList();
		width.Sort();
		foreach (var l in width) {
			if (length >= l) {
				length -= l;
				count++;
			} else break;
		}
		Console.WriteLine(count);
	}
}
0