結果

問題 No.1041 直線大学
ユーザー masutech16masutech16
提出日時 2020-05-01 21:35:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,385 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 167,084 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 07:16:06
合計ジャッジ時間 3,153 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes = "Yes", T no = "No") { cout << (val ? yes : no) << endl; }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}


#line 2 "tmp.cpp"

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;
  vi x(n), y(n);
  REP(i, n) { cin >> x[i] >> y[i]; }

  int ans = 0;
  REP(i, n) {
    FOR(j, i + 1, n) {
      int tmp = 0;
      if (x[i] != x[j] && y[i] != y[j]) {
        REP(k, n) {
          if (y[k] == y[i] || x[k] == x[i])
            continue;
          if ((y[k] - y[i]) * (y[i] - y[j]) == (x[k] - x[i]) * (x[i] - x[j]))
            tmp++;
        }
      } else if (x[i] == x[j]) {
        REP(k, n) {
          if (x[i] == x[k])
            tmp++;
        }
      } else if (y[i] == y[j]) {
        REP(k, n) {
          if (y[i] == y[k])
            tmp++;
        }
      }
      chmax(ans, tmp);
    }
  }
  cout << ans << endl;
  return 0;
}
0