結果
| 問題 | No.1041 直線大学 |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-05 08:05:36 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 544 ms / 2,000 ms |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-05-11 13:44:38 |
| 合計ジャッジ時間 | 7,112 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
コンパイルメッセージ
Syntax OK
ソースコード
def fg(p1,p2,p3)
p2a=p2.zip(p1).map{|e| e[0]-e[1]}
p3a=p3.zip(p1).map{|e| e[0]-e[1]}
return p2a[0]*p3a[1]-p2a[1]*p3a[0]
end
ps=[]
n=gets.to_i
n.times{|e|
ps<<gets.split(" ").map{|e| e.to_i}
}
ans=2
n.times{|i|
(i+1).upto(n-1){|j|
c=2
n.times{|k|
next if i==k || j==k
if fg(ps[i],ps[j],ps[k])==0 then
c+=1
end
}
ans=[ans,c].max
}
}
puts ans
horiesiniti