結果
| 問題 | No.396 クラス替え |
| コンテスト | |
| ユーザー |
adoth
|
| 提出日時 | 2017-11-14 14:01:10 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 1,000 ms |
| コード長 | 472 bytes |
| 記録 | |
| コンパイル時間 | 626 ms |
| コンパイル使用メモリ | 20,704 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-19 08:57:40 |
| 合計ジャッジ時間 | 3,730 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
# https://yukicoder.me/problems/no/396
def select_class(class_M, rank):
ans = rank % (2 * class_M)
if ans == 0:
return 1
elif ans > class_M:
return ans - (2 * (ans - class_M) - 1)
else:
return ans
def main():
N, M = map(int, input().split())
X, Y = map(int, input().split())
hanako = select_class(M, X)
taro = select_class(M, Y)
if hanako == taro:
print("YES")
else:
print("NO")
main()
adoth