結果

問題 No.54 Happy Hallowe'en
ユーザー gigurururugigurururu
提出日時 2014-11-07 08:40:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 2,020 ms / 5,000 ms
コード長 560 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 107,264 KB
実行使用メモリ 23,680 KB
最終ジャッジ日時 2024-04-23 16:39:54
合計ジャッジ時間 11,966 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
19,712 KB
testcase_01 AC 35 ms
19,456 KB
testcase_02 AC 34 ms
19,840 KB
testcase_03 AC 33 ms
19,712 KB
testcase_04 AC 316 ms
20,736 KB
testcase_05 AC 504 ms
20,992 KB
testcase_06 AC 742 ms
21,504 KB
testcase_07 AC 1,131 ms
22,144 KB
testcase_08 AC 1,494 ms
22,912 KB
testcase_09 AC 1,993 ms
23,680 KB
testcase_10 AC 33 ms
19,328 KB
testcase_11 AC 32 ms
19,328 KB
testcase_12 AC 2,020 ms
22,784 KB
testcase_13 AC 1,949 ms
23,296 KB
testcase_14 AC 32 ms
19,712 KB
testcase_15 AC 33 ms
19,712 KB
testcase_16 AC 37 ms
19,788 KB
testcase_17 AC 37 ms
19,840 KB
testcase_18 AC 34 ms
19,712 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.Collections.Generic;
using System.Linq;

namespace Yukicoder
{
	class Program
	{
		public static void Main(string[] args)
		{
			var m = new Dictionary<int,int>();
			var n = int.Parse(Console.ReadLine());
			m[0]=1;
			Enumerable.Range(1,n).Select(_ => Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToList()).ToList().OrderBy(x => x[0]+x[1]).ToList().ForEach(
			x =>{
				for(int i=x[1]-1;i>=0;i--){
					if(m.ContainsKey(i))m[i+x[0]]=1;
				}
			});
			Console.WriteLine("{0}",m.Keys.Max());
		}
	}
}
0