結果
| 問題 | No.1265 Balloon Survival |
| コンテスト | |
| ユーザー |
kotatsuinu5
|
| 提出日時 | 2020-10-23 23:59:09 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 801 bytes |
| 記録 | |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 75,796 KB |
| 最終ジャッジ日時 | 2024-07-21 13:59:48 |
| 合計ジャッジ時間 | 14,089 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 2 TLE * 1 -- * 18 |
ソースコード
import numpy as np
N=int(input())
S=np.full((N,2),0)
for i in range(N):
A,B=map(int,input().split())
S[i][0]=A
S[i][1]=B
count=0
while N!=1:
all_diffs = np.expand_dims(S, axis=1) - np.expand_dims(S, axis=0)
degree_distance = np.sqrt(np.sum(all_diffs ** 2, axis=-1))
tmp=np.where(degree_distance==degree_distance[degree_distance>0].min())
tmp1=tmp[0][0]
tmp2=tmp[0][1]
if tmp1==0:
N-=1
S=np.delete(S,tmp2,0)
count+=1
elif tmp2==0:
N-=1
S=np.delete(S,tmp1,0)
count+=1
else:
N-=2
#print("mohu2")
S=np.delete(S,max(tmp1,tmp2),0)
S=np.delete(S,min(tmp1,tmp2),0)
#print(S)
#print("mohu")
#print("mohu")
print(count)
kotatsuinu5