結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
17,792 KB
testcase_01 AC 20 ms
17,792 KB
testcase_02 AC 21 ms
17,536 KB
testcase_03 AC 21 ms
17,664 KB
testcase_04 WA -
testcase_05 AC 22 ms
17,664 KB
testcase_06 AC 27 ms
17,792 KB
testcase_07 WA -
testcase_08 AC 19 ms
17,664 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(){
//        int kazu = int.Parse(ReadLine());
        string[] temp = ReadLine().Split(' ');
        int a = int.Parse(temp[0]);
        int b = int.Parse(temp[1]);
        int p = int.Parse(temp[2]);
        int q = int.Parse(temp[3]);
        
        int m2 = 1;
        for(int i=0;i<b;i++){
            m2*=2;
            if(m2>=a){
                break;
            }
        }
        
        int ans=0;
        int tsuki =0;
        while(a>0){
            tsuki++;
            int k = tsuki%12;
            if(k==0){
                k=12;
            }
                if(p <= k && k <= p+q-1){
                    a-=m2;
                }else{
                    a-=b;
                }
                ans=tsuki;
                if(a<=0){
                    break;
                }
        }
        WriteLine(ans);
    }
}
0