結果

問題 No.1041 直線大学
ユーザー forest3forest3
提出日時 2020-05-03 12:23:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 583 bytes
コンパイル時間 1,656 ms
コンパイル使用メモリ 167,980 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-02 12:23:27
合計ジャッジ時間 4,108 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<pair<int, int>> XY( N );
	for( int i = 0; i < N; i++ ) {
		int X, Y;
		cin >> X >> Y;
		XY[i] = make_pair( X, Y );
	}

	const double EPS = 0.000001;
	int ans = 0;
	for( int b = 0; b <= 100; b++ ) {
		for( int i = 0; i < N; i++ ) {
			double a = (double)(XY[i].second - b) / XY[i].first;
			int ans1 = 0;
			for( int j = 0; j < N; j++ ) {
				if( fabs( (double)(XY[j].second) - ( XY[j].first * a + b ) ) < EPS ) {
					ans1++;
				}
			}
			ans = max( ans, ans1 );
		}
	}

	cout << ans << endl;
}
0