結果

問題 No.384 マス埋めゲーム2
ユーザー atkrymatkrym
提出日時 2016-11-04 11:55:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 534 bytes
コンパイル時間 1,904 ms
コンパイル使用メモリ 71,512 KB
実行使用メモリ 57,568 KB
最終ジャッジ日時 2023-08-16 13:24:38
合計ジャッジ時間 6,094 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,320 KB
testcase_01 AC 123 ms
56,348 KB
testcase_02 AC 121 ms
55,576 KB
testcase_03 AC 121 ms
55,796 KB
testcase_04 AC 122 ms
56,092 KB
testcase_05 AC 123 ms
56,176 KB
testcase_06 AC 123 ms
55,576 KB
testcase_07 AC 123 ms
55,308 KB
testcase_08 AC 123 ms
55,940 KB
testcase_09 AC 121 ms
55,740 KB
testcase_10 AC 120 ms
55,564 KB
testcase_11 AC 122 ms
56,056 KB
testcase_12 AC 124 ms
55,896 KB
testcase_13 AC 125 ms
57,568 KB
testcase_14 AC 124 ms
55,632 KB
testcase_15 AC 123 ms
55,900 KB
testcase_16 AC 123 ms
56,192 KB
testcase_17 AC 123 ms
56,092 KB
testcase_18 AC 121 ms
55,688 KB
testcase_19 AC 125 ms
55,872 KB
testcase_20 AC 127 ms
56,028 KB
testcase_21 AC 122 ms
56,176 KB
testcase_22 AC 124 ms
55,844 KB
testcase_23 AC 122 ms
55,564 KB
testcase_24 AC 120 ms
55,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        long h = sc.nextLong();
        long w = sc.nextLong();
        long n = sc.nextLong();
        long k = sc.nextLong();
        
        long cnt = h+w-1;
        if (cnt%n==k) {
            System.out.println("YES");
        } else if (n==k&&cnt%n==0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
0