結果
| 問題 |
No.1041 直線大学
|
| コンテスト | |
| ユーザー |
👑 SPD_9X2
|
| 提出日時 | 2020-05-01 21:29:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 497 bytes |
| コンパイル時間 | 346 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 70,272 KB |
| 最終ジャッジ日時 | 2024-12-24 22:02:09 |
| 合計ジャッジ時間 | 3,245 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 6 |
ソースコード
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,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)
SPD_9X2