結果

問題 No.734 Careful Engineer
ユーザー toshiro_yanagi
提出日時 2018-11-26 22:40:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 880 bytes
コンパイル時間 2,765 ms
コンパイル使用メモリ 113,636 KB
実行使用メモリ 18,432 KB
最終ジャッジ日時 2025-06-20 00:45:20
合計ジャッジ時間 3,763 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
            return;
        }
        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