結果
問題 | No.467 隠されていたゲーム |
ユーザー |
![]() |
提出日時 | 2016-12-22 10:18:58 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 946 bytes |
コンパイル時間 | 1,209 ms |
コンパイル使用メモリ | 108,436 KB |
実行使用メモリ | 27,296 KB |
最終ジャッジ日時 | 2024-10-04 16:22:19 |
合計ジャッジ時間 | 3,326 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { int n = int.Parse(Console.ReadLine()); int[] d = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); int x, y; string[] s = Console.ReadLine().Split(' '); x = Math.Abs(int.Parse(s[0])); y = Math.Abs(int.Parse(s[1])); int max = Math.Max(x, y); int dmax = d.Max(); if (max == 0) { Console.WriteLine(0); return; } if (d.Contains(max)) { Console.WriteLine(1); return; } if (dmax > max) { Console.WriteLine(2); } else { Console.WriteLine((max + dmax - 1) / dmax); } } }