結果

問題 No.1041 直線大学
コンテスト
ユーザー r_ishida
提出日時 2026-02-15 07:30:43
言語 PyPy3
(7.3.17)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 652 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 381 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 63,668 KB
最終ジャッジ日時 2026-02-15 07:30:47
合計ジャッジ時間 4,028 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
p = []
for i in range(n):
    a, b = MI()
    p.append([a, b])

ans = 2
for i in range(n-2):
    for j in range(i+1, n-1):
        cnt = 2
        for k in range(j+1, n):
            if (p[k][0]-p[j][0])*(p[j][1]-p[i][1]) == (p[k][1]-p[j][1])*(p[j][0]-p[i][0]):
                cnt += 1
        ans = max(ans, cnt)

print(ans)
0