結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,376 KB
testcase_01 AC 70 ms
71,400 KB
testcase_02 AC 71 ms
71,464 KB
testcase_03 AC 72 ms
71,288 KB
testcase_04 AC 69 ms
71,364 KB
testcase_05 AC 70 ms
71,428 KB
testcase_06 AC 71 ms
71,236 KB
testcase_07 AC 70 ms
71,292 KB
testcase_08 WA -
testcase_09 AC 68 ms
71,252 KB
testcase_10 AC 68 ms
71,116 KB
testcase_11 AC 69 ms
71,288 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 198 ms
80,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 117 ms
77,944 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 72 ms
71,388 KB
testcase_35 AC 68 ms
71,396 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 x in removed or i in removed:
            continue
        elif x==0:
            removed.add(i)
            cnt+=1
        else:
            removed.add(x)
            removed.add(i)
            break

print(cnt)
0