結果

問題 No.740 幻の木
ユーザー clocklrclocklr
提出日時 2018-10-05 22:29:32
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 103,040 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-04-20 17:21:15
合計ジャッジ時間 1,393 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
17,792 KB
testcase_01 AC 22 ms
17,792 KB
testcase_02 AC 22 ms
17,920 KB
testcase_03 AC 22 ms
17,920 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 28 ms
17,792 KB
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 m2 = 1;
        for(int i=0;i<x[1];i++){
            m2 *= 2;
        }
        
        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] -= m2;
            }else{
                x[0] -= x[1];
            }
        }
        WriteLine(month);
    }
}
0