結果

問題 No.1041 直線大学
ユーザー kou_kkkkou_kkk
提出日時 2023-09-18 15:15:21
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 5,231 ms
コンパイル使用メモリ 73,264 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-18 15:15:29
合計ジャッジ時間 6,972 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 9 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 9 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 4 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 4 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 3 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 8 ms
4,380 KB
testcase_24 AC 5 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 10 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils

let
  n = parseInt readLine stdin
  xys = n.newSeqWith stdin.readLine.split.map parseFloat

var
  ans = 2
  cnt: int

for i in 0 ..< n.pred 2:
  for j in i.succ ..< n.pred:
    var x1, x2, x3, y1, y2, y3: float
    (x1, y1) = xys[i]
    (x2, y2) = xys[j]
    let
      dx = x2 - x1
      dy = y2 - y1
    cnt = 2
    
    for k in j.succ ..< n:
      (x3, y3) = xys[k]
      if dy / dx * (x3 - x1) == y3 - y1:
        inc cnt

    ans = ans.max cnt

echo ans
0