結果
| 問題 |
No.166 マス埋めゲーム
|
| コンテスト | |
| ユーザー |
koukonko
|
| 提出日時 | 2015-12-13 02:58:43 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 1,000 ms |
| コード長 | 719 bytes |
| コンパイル時間 | 2,054 ms |
| コンパイル使用メモリ | 73,840 KB |
| 実行使用メモリ | 36,960 KB |
| 最終ジャッジ日時 | 2024-09-15 11:01:38 |
| 合計ジャッジ時間 | 4,294 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
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();
}
}
}
koukonko