Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <bits/stdc++.h>
- using namespace std;
- #define F first
- #define S second
- #define what_is(x) cerr << #x << " is " << x << endl
- typedef long double ld;
- typedef long long ll;
- template<typename T> inline void read(T& a) {
- a = 0;
- char c;
- bool _MINUS_ = false;
- while (!isdigit(c = getchar())) _MINUS_ |= c == '-';
- do a = a * 10 + (c - '0');
- while (isdigit(c = getchar()));
- if (_MINUS_) a *= -1;
- }
- string world[8] = {"U", "D", "R", "L", "UL", "UR", "DR", "DL"};
- const int rx[8] = { -1, 1, 0, 0, -1, -1, 1, 1};
- const int ry[8] = { 0, 0, 1, -1, -1, 1, 1, -1};
- const long long mod = 1000000007;
- const int N = 100100;
- map<tuple<ld,ld,ld>,int> mp;
- struct point {
- ld x, y;
- };
- #define FILE "swap"
- int main() {
- #ifdef LOCAL
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #else
- // freopen(FILE ".in", "r", stdin); /// files !!!
- // freopen(FILE ".out", "w", stdout);
- #endif
- ios_base::sync_with_stdio(0);
- int n;
- cin >> n;
- point p[n];
- for (int i = 0; i < n; i++) {
- cin >> p[i].x >> p[i].y;
- }
- ld aa, bb, cc;
- int ans = -1;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < i; j++) {
- ld a, b, c;
- if (!(p[i].y == p[j].y)) {
- a = 1;
- b = (p[i].x - p[j].x) / (p[j].y - p[i].y);
- } else {
- b = 1;
- a = (p[j].y - p[i].y) / (p[i].x - p[j].x);
- }
- c = -(a * p[i].x + b * p[i].y);
- int cur = ++mp[make_tuple(a, b, c)];
- if (cur >= ans) {
- ans = cur;
- aa = a;
- bb = b;
- cc = c;
- }
- }
- }
- vector<int> res;
- for (int i = 0; i < n; i++) {
- ld w = (ld)(aa) * p[i].x + (ld)(bb) * p[i].y + 1.0 * cc;
- if (abs(w) < 0.000000001) {
- res.push_back(i + 1);
- }
- }
- cout << res.size() << endl;
- for (int i = 0; i < res.size(); i++) {
- cout << res[i] << " ";
- }
- #ifdef TIME
- cerr << "TIME = " << 1. * clock() / CLOCKS_PER_SEC;
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement