結果

問題 No.1265 Balloon Survival
ユーザー tikitaka1201tikitaka1201
提出日時 2020-10-31 10:15:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 685 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 110,136 KB
最終ジャッジ日時 2023-09-29 10:12:19
合計ジャッジ時間 17,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,268 KB
testcase_01 AC 73 ms
71,168 KB
testcase_02 AC 72 ms
71,352 KB
testcase_03 AC 73 ms
71,252 KB
testcase_04 AC 74 ms
71,168 KB
testcase_05 AC 74 ms
71,240 KB
testcase_06 AC 76 ms
71,348 KB
testcase_07 AC 75 ms
71,468 KB
testcase_08 WA -
testcase_09 AC 73 ms
71,320 KB
testcase_10 AC 77 ms
71,100 KB
testcase_11 AC 80 ms
71,480 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 205 ms
80,460 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 118 ms
76,856 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 78 ms
71,256 KB
testcase_35 AC 76 ms
71,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

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

dist=[]
for i in range(n):
    tmp=[]
    for j in range(n):
        if i==j:
            continue
        d=(coord[i][0]-coord[j][0])**2+(coord[i][1]-coord[j][1])**2
        tmp.append((d, j))
    tmp=sorted(tmp)
    dist.append(tmp)

cnt=0
removed=set([])
for i in range(1,n):
    for j in range(n-1):
        x=dist[i][j][1]
        if i in removed:
            break
        elif x in removed:
            continue
        elif x==0:
            removed.add(i)
            cnt+=1
        else:
            removed.add(x)
            removed.add(i)
            break

print(cnt)
0