結果

問題 No.1041 直線大学
ユーザー kenken714kenken714
提出日時 2020-05-01 22:09:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,477 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 97,864 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 14:05:41
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
using namespace std;


#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll unsigned long long
#define INF (ll)1 << 60
#define MINF (2 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>

double eps = 1e-9;
bool check(P a, P b, P c) {
	vector<P> s;
	s.push_back(a);
	s.push_back(b);
	s.push_back(c);
	sort(ALL(s));
	if (s[0].first == s[1].first and s[1].first == s[2].first)return true;
	if (s[0].first == s[1].first or s[1].first == s[2].first)return false;
	double ab = (double)(s[1].second - s[0].second) / (double)(s[1].first - s[0].first);
	double bc = (double)(s[2].second - s[1].second) / (double)(s[2].first - s[1].first);
	return abs(ab - bc) < eps;
}
ll ans;
int main() {
	ll n;
	cin >> n;
	vector<P> s(n);
	REP(i, n)cin >> s[i].first >> s[i].second;
	REP(i, n) {
		FOR(j, i + 1, n) {
			ll now = 2;
			REP(k, n) {
				if (i == k or j == k)continue;
				if (check(s[i], s[j], s[k]))now++;
			}
			ans = max(ans, now);
		}
	}
	cout << ans << endl;
}
0