結果

問題 No.1041 直線大学
コンテスト
ユーザー あるふぁ
提出日時 2026-09-09 17:23:56
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 519 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,780 ms
コンパイル使用メモリ 354,300 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-09 17:24:30
合計ジャッジ時間 6,609 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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 = 0; a <= 100; a++){
    for (int b = 0; b <= 100; b++){
      int cnt = ranges::count_if(A, [&](auto x){return a*x.first+b == x.second;});
      ans = max(ans, cnt);
    }
  }
  
  cout << ans << endl;
}
0