結果

問題 No.1041 直線大学
ユーザー matrie
提出日時 2021-03-05 08:49:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-11-16 08:11:42
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
n=int(input())
if n==2:print(2);exit(0)
L=[list(map(int,input().split())) for _ in [0]*n]
#print(L)
M=[]
for i in range(n):
	for j in range(i+1,n):
		if L[j][0]==L[i][0]:a=101
		else: a=(L[j][1]-L[i][1])/(L[j][0]-L[i][0])+0.
		
		if a>100:b=L[i][0]
		else:b=L[i][1]-a*L[i][0]
		M.append(str(a)+'/'+str(b))
		#print(L[i],L[j],a,b)
S=collections.Counter(M)
#print(S)
print(int((2*S.most_common()[0][1])**.5)+1)
0