結果

問題 No.1265 Balloon Survival
ユーザー taiga000629taiga000629
提出日時 2020-10-24 00:42:58
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 672 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 131,552 KB
最終ジャッジ日時 2023-09-28 19:48:01
合計ジャッジ時間 26,272 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,308 KB
testcase_01 AC 75 ms
71,208 KB
testcase_02 AC 78 ms
70,864 KB
testcase_03 AC 78 ms
71,128 KB
testcase_04 AC 77 ms
71,348 KB
testcase_05 AC 78 ms
71,084 KB
testcase_06 AC 78 ms
71,316 KB
testcase_07 AC 75 ms
71,176 KB
testcase_08 AC 77 ms
71,176 KB
testcase_09 AC 75 ms
71,200 KB
testcase_10 AC 76 ms
71,368 KB
testcase_11 AC 75 ms
71,176 KB
testcase_12 AC 77 ms
71,140 KB
testcase_13 AC 76 ms
71,364 KB
testcase_14 AC 239 ms
83,524 KB
testcase_15 AC 188 ms
81,468 KB
testcase_16 AC 115 ms
75,928 KB
testcase_17 AC 956 ms
105,656 KB
testcase_18 AC 139 ms
79,272 KB
testcase_19 AC 118 ms
76,208 KB
testcase_20 AC 233 ms
83,500 KB
testcase_21 AC 476 ms
90,812 KB
testcase_22 AC 292 ms
85,756 KB
testcase_23 AC 317 ms
86,356 KB
testcase_24 AC 1,990 ms
130,180 KB
testcase_25 TLE -
testcase_26 AC 1,952 ms
131,040 KB
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,970 ms
131,012 KB
testcase_32 TLE -
testcase_33 AC 1,922 ms
130,948 KB
testcase_34 AC 78 ms
71,312 KB
testcase_35 AC 75 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[[0,0] for i in range(n)]
import sys
input=sys.stdin.readline #文字列入力はするな!

for i in range(n):
    x,y=map(int,input().split())

    xy[i][0]=x
    xy[i][1]=y
ans=0

dis=[[0,0,0] for i in range(n*(n-1)//2)]
cnt=0
for i in range(n-1):
    for j in range(i+1,n):
        dis[cnt][0]=(xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2
        dis[cnt][1]=i
        dis[cnt][2]=j
        cnt+=1
dis.sort()
erase=[0]*(n)
for i in range(len(dis)):
    p,q=dis[i][1],dis[i][2]
    if p==0:
        if erase[q]==0:
            ans+=1
            erase[q]=1
    else:
        if erase[p]==erase[q]==0:
            erase[p] = erase[q]=1

print(ans)

0