結果
| 問題 | No.1041 直線大学 | 
| コンテスト | |
| ユーザー | 👑  SPD_9X2 | 
| 提出日時 | 2020-05-01 21:31:02 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 559 bytes | 
| コンパイル時間 | 277 ms | 
| コンパイル使用メモリ | 81,792 KB | 
| 実行使用メモリ | 71,296 KB | 
| 最終ジャッジ日時 | 2024-11-16 07:46:53 | 
| 合計ジャッジ時間 | 3,512 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 36 WA * 1 | 
ソースコード
import math
N = int(input())
XY = []
for i in range(N):
    x,y = map(int,input().split())
    XY.append([x,y])
ans = 1
for i in range(N):
    ox,oy = XY[i]
    dic = {}
    for j in range(i):
        nx,ny = XY[j]
        x = ox-nx
        y = oy-ny
        XX = x // math.gcd(x,y)
        YY = y // math.gcd(x,y)
        if XX < 0:
            XX *= -1
            YY *= -1
        if (XX,YY) not in dic:
            dic[(XX,YY)] = 1
        else:
            dic[(XX,YY)] += 1
    for t in dic:
        ans = max(ans,dic[t] + 1)
print (ans)
            
            
            
        