結果
| 問題 | No.1041 直線大学 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-09 17:24:58 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 529 bytes |
| 記録 | |
| コンパイル時間 | 2,216 ms |
| コンパイル使用メモリ | 356,684 KB |
| 実行使用メモリ | 10,028 KB |
| 最終ジャッジ日時 | 2026-09-09 17:25:20 |
| 合計ジャッジ時間 | 9,239 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<pair<int, int>> A(N);
for (auto& [x, y] : A) cin >> x >> y;
int ans = 0;
for (int i = 0; i <= 100; i++){
int cnt = ranges::count_if(A, [&](auto x){return x.first == i;});
ans = max(ans, cnt);
}
for (int a = -100; a <= 100; a++){
for (int b = -10000; b <= 10000; b++){
int cnt = ranges::count_if(A, [&](auto x){return a*x.first+b == x.second;});
ans = max(ans, cnt);
}
}
cout << ans << endl;
}