結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-15 22:55:33 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 135 ms / 1,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 2,158 ms |
| コンパイル使用メモリ | 74,252 KB |
| 実行使用メモリ | 41,308 KB |
| 最終ジャッジ日時 | 2024-11-17 11:05:31 |
| 合計ジャッジ時間 | 5,677 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
package No300台;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
solver();
}
static void solver() {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long m = sc.nextLong();
long x = sc.nextLong() - 1;
long y = sc.nextLong() - 1;
x = x % (2 * m);
y = y % (2 * m);
if (x == y) {
System.out.println("YES");
} else if (Math.abs(x + y) == 2 * m - 1) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}