結果

問題 No.1041 直線大学
ユーザー okok
提出日時 2020-05-01 21:31:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,084 bytes
コンパイル時間 926 ms
コンパイル使用メモリ 94,492 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-26 07:00:26
合計ジャッジ時間 4,975 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,376 KB
testcase_01 AC 7 ms
4,380 KB
testcase_02 AC 7 ms
4,380 KB
testcase_03 AC 10 ms
4,376 KB
testcase_04 AC 14 ms
4,380 KB
testcase_05 AC 6 ms
4,376 KB
testcase_06 AC 16 ms
4,376 KB
testcase_07 AC 48 ms
4,376 KB
testcase_08 AC 50 ms
4,380 KB
testcase_09 AC 53 ms
4,376 KB
testcase_10 AC 204 ms
4,384 KB
testcase_11 AC 182 ms
4,380 KB
testcase_12 AC 197 ms
4,376 KB
testcase_13 AC 72 ms
4,380 KB
testcase_14 AC 176 ms
4,376 KB
testcase_15 AC 94 ms
4,376 KB
testcase_16 AC 154 ms
4,376 KB
testcase_17 AC 40 ms
4,376 KB
testcase_18 AC 112 ms
4,376 KB
testcase_19 AC 156 ms
4,380 KB
testcase_20 AC 14 ms
4,380 KB
testcase_21 AC 119 ms
4,376 KB
testcase_22 AC 7 ms
4,380 KB
testcase_23 AC 216 ms
4,376 KB
testcase_24 AC 168 ms
4,380 KB
testcase_25 AC 125 ms
4,380 KB
testcase_26 AC 57 ms
4,376 KB
testcase_27 AC 88 ms
4,376 KB
testcase_28 AC 4 ms
4,504 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 5 ms
4,380 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 231 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	const int MAX = 100;
	int N;
	int ans = 0;
	map<pair<int,int>, int> mp;
	vector<pair<int,int>> in;
	cin>>N;
	
	in.resize(N);
	
	for(int i = 0; i < N; i++){
		cin>>in[i].first>>in[i].second;
	}
	
	for(int i = 0; i <= MAX; i++){
		for(int j = 0; j <= MAX; j++){
			mp.clear();
			for(int k = 0; k < N; k++){
				int X, Y, GCD = 0;
				
				X = in[k].first - i;
				Y = in[k].second - j;

				if(X == 0) mp[{0,0}]++;
				else {
					GCD = __gcd(abs(X), abs(Y));

					X /= GCD;
					Y /= GCD;

					mp[{X, Y}]++;
				}
			}
			
			for(pair<pair<int,int>,int> p : mp){
				ans = max(ans, p.second);
			}
	
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}
0