結果

問題 No.740 幻の木
ユーザー Mcpu3Mcpu3
提出日時 2018-10-06 00:14:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 73,664 KB
実行使用メモリ 41,220 KB
最終ジャッジ日時 2024-04-20 17:33:44
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,220 KB
testcase_01 AC 123 ms
41,036 KB
testcase_02 AC 118 ms
41,060 KB
testcase_03 AC 115 ms
41,084 KB
testcase_04 AC 115 ms
41,200 KB
testcase_05 AC 114 ms
41,192 KB
testcase_06 AC 117 ms
41,184 KB
testcase_07 AC 125 ms
41,164 KB
testcase_08 AC 120 ms
41,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), M = sc.nextInt(), P = sc.nextInt(), Q = sc.nextInt(), i;
        sc.close();
        for (i = 0; N > 0; ++i) {
            if (i % 12 + 1 >= P && i % 12 + 1 < P + Q) N -= 2 * M;
            else N -= M;
        }
        System.out.print(i);
    }
}
0