結果
| 問題 | No.740 幻の木 | 
| コンテスト | |
| ユーザー |  clocklr | 
| 提出日時 | 2018-10-05 22:40:55 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 31 ms / 2,000 ms | 
| コード長 | 685 bytes | 
| コンパイル時間 | 1,079 ms | 
| コンパイル使用メモリ | 108,480 KB | 
| 実行使用メモリ | 27,892 KB | 
| 最終ジャッジ日時 | 2024-10-12 13:20:37 | 
| 合計ジャッジ時間 | 1,972 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
    }
}
            
            
            
        