結果

問題 No.1041 直線大学
ユーザー chocoruskchocorusk
提出日時 2020-05-01 21:27:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 932 bytes
コンパイル時間 1,606 ms
コンパイル使用メモリ 122,856 KB
最終ジャッジ日時 2025-01-10 04:11:47
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n; cin>>n;
	int x[101], y[101];
	for(int i=0; i<n; i++) cin>>x[i]>>y[i];
	int ans=0;
	for(int i=0; i<n; i++){
		for(int j=0; j<i; j++){
			int cnt=2;
			int x1=x[i]-x[j], y1=y[i]-y[j];
			for(int k=0; k<n; k++){
				if(k==i || k==j) continue;
				int x2=x[i]-x[k], y2=y[i]-y[k];
				if(x1*y2==x2*y1) cnt++;
			}
			ans=max(ans, cnt);
		}
	}
  cout<<ans<<endl;
	return 0;
}
0