結果
| 問題 | 
                            No.1041 直線大学
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kou_kkk
                         | 
                    
| 提出日時 | 2023-09-18 17:11:53 | 
| 言語 | Nim  (2.2.0)  | 
                    
| 結果 | 
                             
                                CE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 583 bytes | 
| コンパイル時間 | 1,950 ms | 
| コンパイル使用メモリ | 64,768 KB | 
| 最終ジャッジ日時 | 2024-11-16 08:16:37 | 
| 合計ジャッジ時間 | 2,240 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
            
            
            
            
            ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(14, 19) Error: type mismatch: got 'seq[float]' for 'xys[i]' but expected 'tuple'
ソースコード
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 dx == 0 and x1 == x3:
        inc cnt
      elif dy == 0 and y1 == y3:
        inc cnt
      elif dy / dx * (x3 - x1) == y3 - y1:
        inc cnt
    ans = ans.max cnt
echo ans
            
            
            
        
            
kou_kkk