結果
問題 | No.1265 Balloon Survival |
ユーザー |
![]() |
提出日時 | 2021-01-11 19:07:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,661 ms / 2,000 ms |
コード長 | 562 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 133,260 KB |
最終ジャッジ日時 | 2024-11-21 09:18:50 |
合計ジャッジ時間 | 20,524 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 32 |
ソースコード
import sysinput = sys.stdin.buffer.readlinesys.setrecursionlimit(10 ** 7)N = int(input())XY = tuple(tuple(map(int, input().split())) for _ in range(N))dist = []for i, (x, y) in enumerate(XY):for j, (xx, yy) in enumerate(XY):if j >= i:breakd = (x - xx) ** 2 + (y - yy) ** 2dist.append((d, j, i))seen = [0] * Nans = 0dist.sort()for d, i, j in dist:if seen[i] or seen[j]:continueif i == 0:seen[j] = 1ans += 1else:seen[i] = 1seen[j] = 1print(ans)