結果
| 問題 | No.1265 Balloon Survival |
| ユーザー |
|
| 提出日時 | 2020-10-23 23:39:51 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,602 ms / 2,000 ms |
| + 869µs | |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 64,412 KB |
| 実行使用メモリ | 137,072 KB |
| 最終ジャッジ日時 | 2026-11-13 10:46:33 |
| 合計ジャッジ時間 | 22,025 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 35 |
ソースコード
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
x[i], y[i] = map(int, input().split())
def dist(i, j):
return (x[j] - x[i]) ** 2 + (y[j] - y[i]) ** 2
d = []
for i in range(n):
for j in range(i + 1, n):
if i == j:
continue
d.append((dist(i, j), i, j))
d.sort()
used = [False] * n
ans = 0
for _, i, j in d:
if i == 0:
if not used[j]:
ans += 1
used[j] = True
else:
if not used[j] and not used[i]:
used[i] = True
used[j] = True
print(ans)