結果

問題 No.396 クラス替え
ユーザー ぴろずぴろず
提出日時 2016-07-15 22:32:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 380 bytes
コンパイル時間 4,438 ms
コンパイル使用メモリ 83,044 KB
実行使用メモリ 41,352 KB
最終ジャッジ日時 2024-11-17 10:43:40
合計ジャッジ時間 5,070 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

package no396;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int p1 = (x - 1) % (m * 2);
		int p2 = (y - 1) % (m * 2);
		System.out.println((p1 == p2 || p1 + p2 == m * 2 - 1) ? "YES" : "NO");
	}

}
0