結果

問題 No.1265 Balloon Survival
ユーザー tanon710tanon710
提出日時 2020-10-24 00:00:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 154,940 KB
最終ジャッジ日時 2023-09-28 19:20:41
合計ジャッジ時間 19,138 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,656 KB
testcase_01 AC 77 ms
71,580 KB
testcase_02 AC 75 ms
71,068 KB
testcase_03 AC 77 ms
71,664 KB
testcase_04 AC 77 ms
71,724 KB
testcase_05 AC 77 ms
71,656 KB
testcase_06 AC 75 ms
71,792 KB
testcase_07 AC 76 ms
71,692 KB
testcase_08 AC 77 ms
71,688 KB
testcase_09 AC 76 ms
71,696 KB
testcase_10 AC 76 ms
71,216 KB
testcase_11 AC 76 ms
71,832 KB
testcase_12 AC 76 ms
71,692 KB
testcase_13 AC 76 ms
71,688 KB
testcase_14 AC 198 ms
88,048 KB
testcase_15 AC 151 ms
79,732 KB
testcase_16 AC 104 ms
77,012 KB
testcase_17 AC 637 ms
125,084 KB
testcase_18 AC 119 ms
78,180 KB
testcase_19 AC 107 ms
77,348 KB
testcase_20 AC 190 ms
87,652 KB
testcase_21 AC 302 ms
92,892 KB
testcase_22 AC 223 ms
92,240 KB
testcase_23 AC 234 ms
93,012 KB
testcase_24 AC 1,253 ms
154,612 KB
testcase_25 AC 1,247 ms
154,816 KB
testcase_26 AC 1,235 ms
154,940 KB
testcase_27 AC 1,242 ms
154,584 KB
testcase_28 AC 1,218 ms
154,700 KB
testcase_29 AC 1,261 ms
154,604 KB
testcase_30 AC 1,231 ms
154,696 KB
testcase_31 AC 1,248 ms
154,604 KB
testcase_32 AC 1,305 ms
154,572 KB
testcase_33 AC 1,242 ms
154,388 KB
testcase_34 AC 76 ms
71,800 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
pos=[list(map(int,input().split())) for _ in range(n)]
dist=[]
for i in range(n):
    x1,y1=pos[i]
    for j in range(i+1,n):
        x2,y2=pos[j]
        d=((x1-x2)**2+(y1-y2)**2)**0.5
        dist.append((d,i,j))
dist=sorted(dist,key=lambda x:x[0])
used=set()
ans=0
for _,i,j in dist:
    if i==0:
        if j in used:
            continue
        else:
            ans+=1
            used.add(j)
    else:
        if i in used or j in used:
            continue
        else:
            used.add(i)
            used.add(j)
print(ans)
0