Submission #53233632


Source Code Expand

Copy
"""
<>
- `Z``X``Y`
- `min(X, Y) <= Z <= max(X, Y)`
"""
#
N, X, Y, Z = map(int, input().split())
# XYZ
if(min(X, Y) <= Z <= max(X, Y)):
# Yes
print("Yes")
else:
# No
print("No")
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"""
<方針>
- `Z`駅が`X`駅と`Y`駅の間にあるかどうかを判定すれば良い.
- つまり,`min(X, Y) <= Z <= max(X, Y)`となっているかどうかを見れば良い.
"""
# 標準入力を受け取る.
N, X, Y, Z = map(int, input().split())

# X駅とY駅の間にZ駅があるかを見る.
if(min(X, Y) <= Z <= max(X, Y)):
  # Yesを出力をする.
  print("Yes")
else:
  # Noを出力をする.
  print("No")
  

Submission Info

Submission Time
Task A - AtCoder Line
User mattsunkun
Language Python (PyPy 3.10-v7.3.12)
Score 100
Code Size 461 Byte
Status AC
Exec Time 57 ms
Memory 76732 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt
Case Name Status Exec Time Memory
sample00.txt AC 56 ms 76324 KB
sample01.txt AC 56 ms 76208 KB
sample02.txt AC 57 ms 76488 KB
testcase00.txt AC 56 ms 76640 KB
testcase01.txt AC 56 ms 76616 KB
testcase02.txt AC 56 ms 76236 KB
testcase03.txt AC 56 ms 76256 KB
testcase04.txt AC 56 ms 76732 KB
testcase05.txt AC 56 ms 76548 KB
testcase06.txt AC 55 ms 76532 KB
testcase07.txt AC 55 ms 76328 KB
testcase08.txt AC 56 ms 76428 KB


2025-04-03 (Thu)
19:38:32 +00:00