結果

問題 No.1041 直線大学
ユーザー queeequeee
提出日時 2020-05-01 21:33:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 923 bytes
コンパイル時間 621 ms
コンパイル使用メモリ 75,288 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 07:06:11
合計ジャッジ時間 2,250 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std; using ll=long long; const int INF=1e9;
typedef pair<int,int> P;

int main() {
  int n; cin>>n;
  int x[n],y[n];
  for(int i=0;i<n;i++) cin>>x[i]>>y[i];
  int an=0;
  for(int i=0;i<n;i++) {
    for(int j=0;j<n;j++) {
      if (i == j) continue;
      int s = x[i] - x[j];
      int t = y[i] - y[j];

      bool os=s<0, ot=t<0;
      if (os) s*=-1;
      if (ot) t*=-1;

      int sm = 0;
      for(int k=0;k<n;k++) {
        int dx = x[k] - x[i], dy = y[k] - y[i];
        if (os) dx*=-1; if (ot) dy*=-1;
        if (s == 0) {
          if (x[i] == x[k] && dy % t == 0) sm++;
        } else if (t == 0) {
          if (y[i] == y[k] && dx % s == 0) sm++;
        } else {
          if (dy / t == dx / s && dy % t == 0 && dx % s == 0) sm++;
        }
      }
      an = max(an, sm);
    }
  }
  cout<<an<<endl;
}
0