結果

問題 No.166 マス埋めゲーム
ユーザー YamaKasaYamaKasa
提出日時 2018-05-17 22:37:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 1,000 ms
コード長 514 bytes
コンパイル時間 2,039 ms
コンパイル使用メモリ 70,928 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-09-10 22:41:52
合計ジャッジ時間 5,806 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,584 KB
testcase_01 AC 118 ms
56,128 KB
testcase_02 AC 119 ms
55,620 KB
testcase_03 AC 119 ms
56,100 KB
testcase_04 AC 120 ms
55,776 KB
testcase_05 AC 119 ms
55,564 KB
testcase_06 AC 119 ms
55,676 KB
testcase_07 AC 121 ms
55,972 KB
testcase_08 AC 120 ms
56,108 KB
testcase_09 AC 120 ms
56,092 KB
testcase_10 AC 121 ms
55,856 KB
testcase_11 AC 120 ms
55,388 KB
testcase_12 AC 119 ms
56,016 KB
testcase_13 AC 121 ms
56,084 KB
testcase_14 AC 121 ms
56,040 KB
testcase_15 AC 119 ms
55,332 KB
testcase_16 AC 119 ms
54,488 KB
testcase_17 AC 120 ms
55,672 KB
testcase_18 AC 122 ms
55,564 KB
testcase_19 AC 120 ms
55,396 KB
testcase_20 AC 121 ms
55,768 KB
testcase_21 AC 120 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long H = scan.nextLong();
		long W = scan.nextLong();
		long N = scan.nextLong();
		long K = scan.nextLong();
		scan.close();
		long r = ((H % N) * (W % N)) % N;
		if(r == 0) {
			if(K == N) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
		}else {
			if(r == K) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}

		}
	}
}
0