結果

問題 No.740 幻の木
ユーザー clocklrclocklr
提出日時 2018-10-05 22:40:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 999 ms
コンパイル使用メモリ 103,296 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-20 17:25:22
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,664 KB
testcase_01 AC 27 ms
17,920 KB
testcase_02 AC 26 ms
17,792 KB
testcase_03 AC 27 ms
17,664 KB
testcase_04 AC 27 ms
17,792 KB
testcase_05 AC 26 ms
17,920 KB
testcase_06 AC 34 ms
17,536 KB
testcase_07 AC 28 ms
17,664 KB
testcase_08 AC 28 ms
17,920 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 static System.Console;
using static System.Math;

public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        int[] x = new int[input.Length];
        for(int i=0;i<input.Length;i++){
            x[i] = int.Parse(input[i]);
        }
        
        int month = 0;
        while(x[0] > 0){
            month++;
            int tsuki = month % 12;
            if(tsuki == 0){
                tsuki = 12;
            }
            if(x[2] <= tsuki && tsuki <= x[2] + x[3] - 1){
                x[0] -= x[1] * 2;
            }else{
                x[0] -= x[1];
            }
        }
        WriteLine(month);
    }
}
0