結果

問題 No.166 マス埋めゲーム
ユーザー koukonkokoukonko
提出日時 2015-12-13 02:58:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 1,000 ms
コード長 719 bytes
コンパイル時間 1,945 ms
コンパイル使用メモリ 72,024 KB
実行使用メモリ 49,508 KB
最終ジャッジ日時 2023-10-13 14:14:10
合計ジャッジ時間 4,090 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,452 KB
testcase_01 AC 42 ms
49,420 KB
testcase_02 AC 43 ms
49,308 KB
testcase_03 AC 44 ms
49,272 KB
testcase_04 AC 43 ms
48,968 KB
testcase_05 AC 43 ms
49,224 KB
testcase_06 AC 43 ms
49,096 KB
testcase_07 AC 43 ms
49,120 KB
testcase_08 AC 44 ms
49,220 KB
testcase_09 AC 44 ms
49,280 KB
testcase_10 AC 44 ms
49,208 KB
testcase_11 AC 43 ms
49,160 KB
testcase_12 AC 43 ms
47,296 KB
testcase_13 AC 43 ms
49,188 KB
testcase_14 AC 43 ms
49,508 KB
testcase_15 AC 43 ms
49,404 KB
testcase_16 AC 45 ms
49,224 KB
testcase_17 AC 43 ms
49,272 KB
testcase_18 AC 44 ms
47,320 KB
testcase_19 AC 43 ms
49,220 KB
testcase_20 AC 44 ms
49,180 KB
testcase_21 AC 44 ms
49,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		try {
			String[] line = read.readLine().split(" ");
			long[] num = new long[4];
			for (int i = 0; i < 4; ++i) {
				num[i] = Long.parseLong(line[i]);
			}
			long total = num[0] * num[1];

			if (total % num[2] == num[3]) {
				System.out.println("YES");
			} else if (total % num[2] == 0) {
				if (num[2] == num[3]) {
					System.out.println("YES");
				} else {
					System.out.println("NO");
				}
			} else {
				System.out.println("NO");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
0