結果
| 問題 |
No.3074 Divide Points Fairly
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 21:26:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 326 ms |
| コンパイル使用メモリ | 81,956 KB |
| 実行使用メモリ | 95,596 KB |
| 最終ジャッジ日時 | 2025-06-12 21:27:23 |
| 合計ジャッジ時間 | 11,148 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 42 |
ソースコード
def main():
import sys
input = sys.stdin.read().split()
n = int(input[0])
intervals = []
idx = 1
for _ in range(n):
a = int(input[idx])
b = int(input[idx + 1])
intervals.append((a, b))
idx += 2
# Sort intervals by their right end
intervals.sort(key=lambda x: x[1])
last = -1
for a, b in intervals:
if a > last:
last = b
# Since the problem can always be satisfied, output Yes
print("Yes")
if __name__ == "__main__":
main()
gew1fw