結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
tookunn_1213
|
| 提出日時 | 2016-07-15 23:12:26 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 1,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-17 11:07:02 |
| 合計ジャッジ時間 | 1,459 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
N,M = map(int,input().split())
X,Y = map(int,input().split())
X,Y = X - 1,Y - 1
if ((X // M) % 2) == 0 and ((Y // M) % 2) == 0:
if X % M == Y % M:
print('YES')
else:
print('NO')
elif ((X // M) % 2) == 0 and ((Y // M) % 2) == 1:
if X % M == M - 1 - (Y % M):
print('YES')
else:
print('NO')
elif ((X // M) % 2) == 1 and ((Y // M) % 2) == 0:
if M - 1 - (X % M) == Y % M:
print('YES')
else:
print('NO')
else:
if X % M == Y % M:
print('YES')
else:
print('NO')
tookunn_1213