結果
| 問題 | No.1265 Balloon Survival |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-19 21:57:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 1,112 ms / 2,000 ms |
| + 996µs | |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 96,236 KB |
| 実行使用メモリ | 149,760 KB |
| 最終ジャッジ日時 | 2026-08-03 16:53:53 |
| 合計ジャッジ時間 | 16,007 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 32 |
ソースコード
N = int(input())
lsxy = [tuple(map(int,input().split())) for i in range(N)]
ls = []
for i in range(N-1):
for j in range(i+1,N):
dist = (lsxy[i][0]-lsxy[j][0])**2 + (lsxy[i][1]-lsxy[j][1])**2
ls.append((dist,i,j))
ls.sort()
setrm = []
used = [False]*N
for i in range(len(ls)):
d,a,b = ls[i]
if a == 0 and used[b] == False:
used[b] = True
setrm.append(b)
elif used[a] or used[b]:
continue
else:
used[a] = True
used[b] = True
print(len(setrm))