結果

問題 No.1265 Balloon Survival
ユーザー proriboneproribone
提出日時 2020-10-24 00:19:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,888 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 155,080 KB
最終ジャッジ日時 2023-09-28 19:31:35
合計ジャッジ時間 24,719 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,872 KB
testcase_01 AC 75 ms
71,016 KB
testcase_02 AC 75 ms
71,396 KB
testcase_03 AC 75 ms
71,120 KB
testcase_04 AC 75 ms
71,008 KB
testcase_05 AC 75 ms
71,280 KB
testcase_06 AC 75 ms
71,252 KB
testcase_07 AC 77 ms
71,280 KB
testcase_08 AC 76 ms
71,080 KB
testcase_09 AC 76 ms
71,120 KB
testcase_10 AC 77 ms
70,876 KB
testcase_11 AC 77 ms
71,328 KB
testcase_12 AC 76 ms
71,184 KB
testcase_13 AC 76 ms
71,348 KB
testcase_14 AC 216 ms
80,004 KB
testcase_15 AC 177 ms
78,580 KB
testcase_16 AC 112 ms
76,276 KB
testcase_17 AC 828 ms
102,148 KB
testcase_18 AC 135 ms
77,016 KB
testcase_19 AC 119 ms
76,208 KB
testcase_20 AC 211 ms
80,036 KB
testcase_21 AC 434 ms
91,248 KB
testcase_22 AC 292 ms
91,040 KB
testcase_23 AC 314 ms
91,624 KB
testcase_24 AC 1,856 ms
153,824 KB
testcase_25 AC 1,845 ms
154,584 KB
testcase_26 AC 1,844 ms
154,804 KB
testcase_27 AC 1,828 ms
154,340 KB
testcase_28 AC 1,842 ms
155,080 KB
testcase_29 AC 1,874 ms
154,676 KB
testcase_30 AC 1,829 ms
154,660 KB
testcase_31 AC 1,815 ms
154,160 KB
testcase_32 AC 1,888 ms
154,468 KB
testcase_33 AC 1,839 ms
154,828 KB
testcase_34 AC 75 ms
71,320 KB
testcase_35 AC 72 ms
70,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def dist(p,q):
    a,b=p[0]-q[0],p[1]-q[1]
    return a**2+b**2
    
N=int(input())
point=[tuple(map(int,input().split())) for _ in range(N)]
G=[]

isv=[True]*N

for i in range(N):
    for j in range(i+1,N):
        G.append((dist(point[i],point[j]),i,j))
G.sort()
res=0
for d,i,j in G:
    if i==0:
        if isv[j]:
            res+=1
            isv[j]=False
    if j==0:
        if isv[i]:
            res+=1
            isv[i]=False
    else:
        if not isv[i] or not isv[j]:
            continue
        isv[i]=False
        isv[j]=False
print(res)
0