結果
| 問題 |
No.1041 直線大学
|
| ユーザー |
nadeshino
|
| 提出日時 | 2020-05-01 21:35:29 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 591 bytes |
| コンパイル時間 | 4,233 ms |
| コンパイル使用メモリ | 65,508 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 07:49:41 |
| 合計ジャッジ時間 | 4,686 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
import sequtils, strutils
let read* = iterator: string =
while true: (for s in stdin.readLine.split: yield s)
template input*(T: static[typedesc]): untyped =
when T is int: read().parseInt
elif T is float: read().parseFloat
elif T is string: read()
let N = input(int)
let P: seq[tuple[x: int, y: int]] =
newSeqWith(N, (input(int), input(int)))
var res = 1
for (x1, y1) in P:
for (x2, y2) in P:
if (x1, y1) == (x2, y2): continue
var cnt = 0
for (x, y) in P:
if (x2 - x1) * (y - y1) == (y2 - y1) * (x - x1):
cnt += 1
res = max(res, cnt)
echo res
nadeshino