結果
| 問題 |
No.1041 直線大学
|
| コンテスト | |
| ユーザー |
liny_tail
|
| 提出日時 | 2024-08-16 16:42:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 538 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,904 KB |
| 最終ジャッジ日時 | 2024-08-16 16:42:15 |
| 合計ジャッジ時間 | 2,968 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 15 |
ソースコード
import collections, itertools
F = lambda i,j : (j[1]-i[1])/(j[0]-i[0]) if j[0]-i[0] != 0 else None
N = int(input())
P = []
for i in range(N):
P.append(list(map(int, input().split(' '))))
lst = []
dic = {}
for x, y in itertools.combinations(range(len(P)), r=2):
a = F(P[x], P[y])
b = P[x][1] - a*P[x][1] if a != None else P[x][0]
A = str(a) + '_' + str(b)
lst.append(A)
try:
dic[A].append(x)
dic[A].append(y)
except:
dic[A] = [x, y]
c = collections.Counter(lst)
print(len(set(dic[c.most_common(1)[0][0]])))
liny_tail