結果

問題 No.734 Careful Engineer
ユーザー toshiro_yanagi
提出日時 2018-11-26 22:38:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 860 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 110,992 KB
実行使用メモリ 26,108 KB
最終ジャッジ日時 2024-06-11 16:03:44
合計ジャッジ時間 1,670 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program {
    static void Main() {
        var hand = NextInt() * 60L;
        var runCost = NextInt();
        var initCost = NextInt() * 3600L;

        if (hand <= runCost) {
            WriteLine(-1);
        }
        WriteLine((initCost - 1) / (hand - runCost) + 1);
    }

    static int NextInt() {
        return int.Parse(NextString());
    }

    static string NextString() {
        var result = new List<char>();
        while (true) {
            int next = Read();
            if (next < 0)
                break;
            var nextChar = (char)next;
            if (!char.IsWhiteSpace(nextChar))
                result.Add(nextChar);
            else if (nextChar != '\r')
                break;
        }
        return string.Join("", result);
    }
}
0