結果

問題 No.138 化石のバージョン
ユーザー Masahiro HayashiMasahiro Hayashi
提出日時 2015-05-31 16:12:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,832 bytes
コンパイル時間 2,262 ms
コンパイル使用メモリ 104,012 KB
実行使用メモリ 23,036 KB
最終ジャッジ日時 2023-08-28 13:25:38
合計ジャッジ時間 5,768 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
23,036 KB
testcase_01 AC 59 ms
20,780 KB
testcase_02 AC 58 ms
20,840 KB
testcase_03 AC 56 ms
20,840 KB
testcase_04 AC 57 ms
20,828 KB
testcase_05 AC 57 ms
20,896 KB
testcase_06 AC 57 ms
20,836 KB
testcase_07 AC 57 ms
20,896 KB
testcase_08 AC 57 ms
20,908 KB
testcase_09 AC 58 ms
20,948 KB
testcase_10 AC 58 ms
22,836 KB
testcase_11 AC 58 ms
20,900 KB
testcase_12 AC 58 ms
20,844 KB
testcase_13 AC 57 ms
18,860 KB
testcase_14 AC 57 ms
22,920 KB
testcase_15 AC 57 ms
20,852 KB
testcase_16 AC 57 ms
20,904 KB
testcase_17 AC 57 ms
20,792 KB
testcase_18 AC 57 ms
22,876 KB
testcase_19 AC 57 ms
22,888 KB
testcase_20 AC 58 ms
22,880 KB
testcase_21 AC 57 ms
20,856 KB
testcase_22 AC 58 ms
20,936 KB
testcase_23 AC 58 ms
22,868 KB
testcase_24 AC 57 ms
20,896 KB
testcase_25 AC 57 ms
20,860 KB
testcase_26 AC 59 ms
20,784 KB
testcase_27 AC 58 ms
18,876 KB
testcase_28 AC 58 ms
20,856 KB
testcase_29 AC 57 ms
21,032 KB
testcase_30 AC 58 ms
20,932 KB
testcase_31 AC 60 ms
20,944 KB
testcase_32 AC 58 ms
20,956 KB
testcase_33 AC 58 ms
18,796 KB
testcase_34 AC 57 ms
20,944 KB
testcase_35 AC 58 ms
20,956 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;
using System.Text;

namespace Application
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			new MainClass ().Calc ();
		}

		public MainClass ()
		{
		}

		public void Calc ()
		{
			var scan = new Scanner ();
			var A = scan.NextToken ();
			var B = scan.NextToken ();

			var va = new Version (A);
			var vb = new Version (B);

			Console.WriteLine ((va.CompareTo (vb) >= 0) ? "YES" : "NO");
		}

		void WriteLine (object o)
		{
			System.Console.WriteLine (o.ToString ());
		}

		void WriteEnum<T> (IEnumerable<T> l)
		{
			WriteLine (JoinList (l));
		}

		string JoinList<T> (IEnumerable<T> l)
		{
			return string.Join (" ", l.Select (x => x.ToString ()).ToArray ());
		}
	}

	class Scanner
	{
		public int[] NextDigits (int count)
		{
			return Enumerable.Range (0, count)
                .Select (x => NextDigit ()).ToArray ();
		}

		public string NextToken ()
		{
			int i;
			var r = new List<char> ();

			while ((i = System.Console.Read()) >= 0) {
				var c = Convert.ToChar (i);

				if (IsSpace (c) && r.Count > 0)
					break;

				r.Add (c);
			}

			return new string (r.ToArray ());
		}

		bool IsSpace (char c)
		{
			if (char.IsWhiteSpace (c))
				return true;

			return false;
		}

		public int NextDigit ()
		{
			var token = NextToken ();

			return int.Parse (token);
		}
	}

	class Reader
	{
		public string Item ()
		{
			return Items () [0];
		}

		public String[] Items ()
		{
			return this.Items (' ');
		}

		public String[] Items (char c)
		{
			return System.Console.ReadLine ().Split (c);
		}

		public int Int ()
		{
			return Ints (' ') [0];
		}

		public int[] Ints ()
		{
			return this.Ints (' ');
		}

		public int[] Ints (char c)
		{
			return Items (c).Select (x => int.Parse (x)).ToArray ();
		}
	}
}
0