結果

問題 No.396 クラス替え
ユーザー 37zigen37zigen
提出日時 2016-07-15 22:55:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 1,000 ms
コード長 506 bytes
コンパイル時間 1,846 ms
コンパイル使用メモリ 70,796 KB
実行使用メモリ 56,492 KB
最終ジャッジ日時 2023-08-11 00:06:04
合計ジャッジ時間 5,222 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,176 KB
testcase_01 AC 120 ms
55,732 KB
testcase_02 AC 117 ms
56,084 KB
testcase_03 AC 119 ms
55,976 KB
testcase_04 AC 122 ms
56,260 KB
testcase_05 AC 117 ms
56,076 KB
testcase_06 AC 120 ms
56,492 KB
testcase_07 AC 115 ms
56,240 KB
testcase_08 AC 117 ms
56,184 KB
testcase_09 AC 118 ms
56,168 KB
testcase_10 AC 117 ms
56,372 KB
testcase_11 AC 118 ms
55,772 KB
testcase_12 AC 117 ms
54,500 KB
testcase_13 AC 116 ms
56,228 KB
testcase_14 AC 118 ms
55,872 KB
testcase_15 AC 118 ms
54,376 KB
testcase_16 AC 119 ms
55,840 KB
testcase_17 AC 119 ms
56,132 KB
testcase_18 AC 118 ms
56,368 KB
testcase_19 AC 120 ms
56,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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");
		}
	}
}
0