結果
問題 | No.396 クラス替え |
ユーザー |
![]() |
提出日時 | 2016-10-16 20:43:34 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 134 ms / 1,000 ms |
コード長 | 478 bytes |
コンパイル時間 | 6,708 ms |
コンパイル使用メモリ | 73,712 KB |
実行使用メモリ | 46,320 KB |
最終ジャッジ日時 | 2024-11-22 12:07:36 |
合計ジャッジ時間 | 10,332 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt() - 1, y = sc.nextInt() - 1; int a, b; if ((x / m) % 2 == 0) { a = x % m; } else { a = m - 1 - (x % m); } if ((y / m) % 2 == 0) { b = y % m; } else { b = m - 1 - (y % m); } if (a == b) { System.out.println("YES"); } else { System.out.println("NO"); } } }