結果

問題 No.1041 直線大学
ユーザー trineutrontrineutron
提出日時 2019-11-12 15:35:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 864 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 180,628 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 14:42:27
合計ジャッジ時間 4,478 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 5 ms
5,376 KB
testcase_02 AC 4 ms
5,376 KB
testcase_03 AC 6 ms
5,376 KB
testcase_04 AC 8 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 9 ms
5,376 KB
testcase_07 AC 25 ms
5,376 KB
testcase_08 AC 25 ms
5,376 KB
testcase_09 AC 26 ms
5,376 KB
testcase_10 AC 112 ms
5,376 KB
testcase_11 AC 104 ms
5,376 KB
testcase_12 AC 107 ms
5,376 KB
testcase_13 AC 47 ms
5,376 KB
testcase_14 AC 145 ms
5,376 KB
testcase_15 AC 67 ms
5,376 KB
testcase_16 AC 126 ms
5,376 KB
testcase_17 AC 23 ms
5,376 KB
testcase_18 AC 86 ms
5,376 KB
testcase_19 AC 123 ms
5,376 KB
testcase_20 AC 8 ms
5,376 KB
testcase_21 AC 88 ms
5,376 KB
testcase_22 AC 5 ms
5,376 KB
testcase_23 AC 186 ms
5,376 KB
testcase_24 AC 139 ms
5,376 KB
testcase_25 AC 92 ms
5,376 KB
testcase_26 AC 35 ms
5,376 KB
testcase_27 AC 60 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 3 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 3 ms
5,376 KB
testcase_32 AC 3 ms
5,376 KB
testcase_33 AC 3 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 WA -
testcase_36 AC 2 ms
5,376 KB
testcase_37 WA -
testcase_38 AC 179 ms
5,376 KB
testcase_39 AC 51 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    assert(2 <= n && n <= 100);
    vector<int> x(n), y(n);
    set<pair<int, int>> check;
    for (int i = 0; i < n; i++) {
        cin >> x.at(i) >> y.at(i);
        assert(0 <= x.at(i) && x.at(i) <= 100);
        assert(0 <= y.at(i) && y.at(i) <= 100);
        assert(check.find(make_pair(x.at(i), y.at(i))) == check.end());
        check.emplace(x.at(i), y.at(i));
    }
    int ans = 0;
    for (int i = -100; i <= 100; i++) {
        for (int j = 0; j <= 99; j++) {
            if (i == 0 && j == 0) continue;
            map<int, int> m;
            for (int k = 0; k < n; k++) {
                m[i * x.at(k) + j * y.at(k)]++;
            }
            for (auto s : m) {
                ans = max(ans, s.second);
            }
        }
    }
    cout << ans << endl;
}
0