結果
| 問題 |
No.1041 直線大学
|
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2020-05-01 21:36:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| コンパイル時間 | 1,081 ms |
| コンパイル使用メモリ | 81,172 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 23:08:32 |
| 合計ジャッジ時間 | 2,226 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
int main() {
int N;
std::cin >> N;
std::vector<int> X(N), Y(N);
for (int i = 0; i < N; i++) std::cin >> X[i] >> Y[i];
int ans = 0;
for (int i = 0; i < N; i++) {
std::map<double, int> m;
for (int j = i + 1; j < N; j++)
m[(double)(Y[j] - Y[i]) / (X[j] - X[i])]++;
for (auto p : m)
ans = std::max(ans, p.second + 1);
}
std::cout << ans << "\n";
}
Strorkis