結果
| 問題 | No.1041 直線大学 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-21 15:31:00 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 223 ms / 2,000 ms |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-11 13:33:54 |
| 合計ジャッジ時間 | 6,372 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
from itertools import combinations
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
ans = 0
for c in combinations(xy, 2):
a, b = c
x1, y1 = a
x2, y2 = b
cnt = 0
for x, y in xy:
if (x1 - x) * (y1 - y2) == (x1 - x2) * (y1 - y):
cnt += 1
ans = max(ans, cnt)
print(ans)