結果
| 問題 | No.1265 Balloon Survival |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-07 16:35:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 360 ms |
| コンパイル使用メモリ | 85,696 KB |
| 実行使用メモリ | 145,376 KB |
| 最終ジャッジ日時 | 2026-03-05 21:40:46 |
| 合計ジャッジ時間 | 24,551 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 TLE * 5 |
ソースコード
n = int(input())
X = [0] * n
Y = [0] * n
for i in range(n):
X[i], Y[i] = map(int, input().split())
dist = []
for i in range(n):
for j in range(i + 1, n):
dx = X[j] - X[i]
dy = Y[j] - Y[i]
dist.append((dx ** 2 + dy ** 2, i, j))
dist.sort()
used = [False] * n
ans = 0
for _, i, j in dist:
if i == 0:
if not used[j]:
ans += 1
used[j] = True
elif not used[i] and not used[j]:
used[i] = used[j] = True
print(ans)