結果

問題 No.467 隠されていたゲーム
ユーザー 14番14番
提出日時 2016-12-18 13:20:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 1,501 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 114,924 KB
実行使用メモリ 27,848 KB
最終ジャッジ日時 2024-04-15 04:42:57
合計ジャッジ時間 3,214 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
25,476 KB
testcase_01 AC 35 ms
25,412 KB
testcase_02 AC 35 ms
25,256 KB
testcase_03 AC 34 ms
25,604 KB
testcase_04 AC 36 ms
25,416 KB
testcase_05 AC 36 ms
27,512 KB
testcase_06 AC 37 ms
25,724 KB
testcase_07 AC 36 ms
27,512 KB
testcase_08 AC 35 ms
27,384 KB
testcase_09 AC 34 ms
25,600 KB
testcase_10 AC 36 ms
27,388 KB
testcase_11 AC 35 ms
27,300 KB
testcase_12 AC 35 ms
25,344 KB
testcase_13 AC 34 ms
25,344 KB
testcase_14 AC 35 ms
25,396 KB
testcase_15 AC 34 ms
27,436 KB
testcase_16 AC 34 ms
25,468 KB
testcase_17 AC 34 ms
27,556 KB
testcase_18 AC 35 ms
27,848 KB
testcase_19 AC 36 ms
27,444 KB
testcase_20 AC 35 ms
25,676 KB
testcase_21 AC 34 ms
25,780 KB
testcase_22 AC 35 ms
25,472 KB
testcase_23 AC 33 ms
25,468 KB
testcase_24 AC 35 ms
27,572 KB
testcase_25 AC 35 ms
25,548 KB
testcase_26 AC 34 ms
27,680 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.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{
    public void Proc() {
        Reader.IsDebug = false;
        int itemCount = int.Parse(Reader.ReadLine());
        long[] items = Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).OrderByDescending(a=>a).ToArray();
        long range = Reader.ReadLine().Split(' ').Select(a=>Math.Abs(long.Parse(a))).Max();

        long amari = range;
        if(range > items[0] * 2) {
            amari = range % (items[0]);
            if(amari + items[0] < items[0] * 2) {
                amari+=items[0];
            }
        }
        long ans = (range-amari)/items[0];
        
        if(amari == 0) {

        } else if(items.Any(a=>a==amari)) {
            ans++;
        } else {
            ans+=2;
        }
        Console.WriteLine(ans);
    }


    public class Reader {
        public static bool IsDebug = true;
        private static System.IO.StringReader SReader;
        private static string InitText = @"



2
5 9
4 0



";
        public static string ReadLine() {
            if(IsDebug) {
                if(SReader == null) {
                    SReader = new System.IO.StringReader(InitText.Trim());
                }
                return SReader.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }
    }
    public static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0