結果

問題 No.1041 直線大学
コンテスト
ユーザー ikd
提出日時 2020-05-01 21:41:55
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 582 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,649 ms
コンパイル使用メモリ 67,816 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-11 12:53:06
合計ジャッジ時間 5,930 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import strutils

let read = iterator: string {.closure.} =
  while true:
    for s in stdin.readLine.split:
      yield s

proc main() =
  let n = read().parseInt
  type P = tuple[x, y: int]
  var pts = newSeq[P]()
  for i in 0..<n:
    let x, y = read().parseInt
    pts.add((x, y))

  var ans = 0
  for p in pts:
    for q in pts:
      var cnt = 2
      if p == q:
        continue
      for r in pts:
        if p == r or q == r:
          continue
        if (r.y - p.y) * (r.x - q.x) == (r.y - q.y) * (r.x - p.x):
          cnt += 1
      ans = max(ans, cnt)
  echo ans
main()
0