結果

問題 No.467 隠されていたゲーム
ユーザー fiordfiord
提出日時 2017-02-28 00:11:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 918 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 109,588 KB
実行使用メモリ 26,484 KB
最終ジャッジ日時 2024-04-15 04:47:09
合計ジャッジ時間 2,407 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,352 KB
testcase_01 AC 27 ms
26,484 KB
testcase_02 AC 27 ms
24,436 KB
testcase_03 AC 27 ms
24,224 KB
testcase_04 AC 27 ms
24,352 KB
testcase_05 AC 27 ms
24,240 KB
testcase_06 AC 27 ms
22,328 KB
testcase_07 AC 28 ms
26,348 KB
testcase_08 AC 27 ms
24,240 KB
testcase_09 AC 26 ms
24,096 KB
testcase_10 AC 27 ms
24,432 KB
testcase_11 AC 30 ms
24,232 KB
testcase_12 AC 26 ms
24,612 KB
testcase_13 AC 26 ms
24,480 KB
testcase_14 AC 27 ms
24,304 KB
testcase_15 AC 26 ms
24,244 KB
testcase_16 AC 26 ms
24,352 KB
testcase_17 AC 28 ms
22,328 KB
testcase_18 AC 28 ms
24,304 KB
testcase_19 AC 27 ms
24,368 KB
testcase_20 AC 26 ms
24,368 KB
testcase_21 AC 27 ms
24,056 KB
testcase_22 AC 27 ms
24,484 KB
testcase_23 AC 27 ms
24,308 KB
testcase_24 AC 27 ms
26,352 KB
testcase_25 AC 27 ms
24,484 KB
testcase_26 AC 26 ms
22,328 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;
using System.Threading.Tasks;

namespace ConsoleApplicationSharp
{
	class Program
	{
		static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			decimal[] d = new decimal[n];
			String[] s = Console.ReadLine().Split(' ');
			decimal big = 0;
			for(int i = 0; i < n; i++)
			{
				d[i] = decimal.Parse(s[i]);
				big = Math.Max(d[i], big);
			}
			
			s = Console.ReadLine().Split(' ');
			decimal x = decimal.Parse(s[0]), y = decimal.Parse(s[1]);
			x = Math.Abs(x);	y = Math.Abs(y);
			//答えが0のとき
			if (x + y == 0)
			{
				Console.WriteLine(0);
				return;
			}
			//答えが1のとき
			int check = Array.IndexOf(d, Math.Max(x, y));
			if (check != -1)
			{
				Console.WriteLine(1);
				return;
			}
			else Console.WriteLine(Math.Max((int)Math.Ceiling(Math.Max(x, y) / big), 2));
		}
	}
}
0