結果
問題 | No.1265 Balloon Survival |
ユーザー |
|
提出日時 | 2020-12-03 23:38:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 118,652 KB |
最終ジャッジ日時 | 2024-09-14 09:03:33 |
合計ジャッジ時間 | 25,152 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 TLE * 10 |
ソースコード
def distance(X, Y):return abs(X[0] - Y[0])**2 + abs(X[1] - Y[1])**2n = int(input())xy = [list(map(int, input().split())) for _ in range(n)]d = []for i in range(n):for g in range(i+1, n):d.append((distance(xy[i], xy[g]), (i, g)))d.sort()delete = set()exploded = set()cnt = 0used = [False]*nfor i, x in d:if (x[0] in delete) or (x[1] in delete) or (x[0] in exploded) or (x[1] in exploded):continueif x[0] == 0:delete.add(x[1])else:exploded.add(x[0])exploded.add(x[1])print(len(delete))