Submission #526055


Source Code Expand

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

typedef long long int64;

int main() {
    const int64 pre = (-1L) ^ ((1L << 32) - 1);
    const int64 post = ((1L << 32) - 1);
    int n;
    int x, y;
    vector<pair<int, int> > pts;
    map<pair<int, int>, int> mp;
//  vector<int64> pts;
//  map<int64, int> mp;
    cin >> n;
    for(int i = 1; i <= n; i++) {
        cin >> x >> y;
//      cout << x << " " << y << endl;
//      int64 p = (((x << 32) & pre) | (y & post));
//      cout << p << endl;
        pair<int, int> p = make_pair(x, y);
        pts.push_back(p);
        mp[p] = i;
    }
    vector<int> res;
    for(int i = 1; i < n; i++) {
        for(int j = i + 1; j <= n; j++) {
            pair<int, int> p1 = pts[i - 1], p2 = pts[j - 1];
            int x1 = p1.first, y1 = p1.second, x2 = p2.first, y2 = p2.second;
//          int x1 = (int)((p1 & pre) >> 32), y1 = (int)(p1 & post), x2 = (int)((p2 & pre) >> 32), y2 = (int)(p
2 & post);
//          cout << x1 << ", " << y1 << " " << x2 << ", " << y2 << endl;
            if(x1 != x2 && y1 != y2) {
//              int64 p3 = ((((int64)x1 << 32) & pre) | (y2 & post)), p4 = ((((int64)x2 << 32) & pre) | (y1 & p
ost));
                pair<int, int> p3 = make_pair(x1, y2), p4 = make_pair(x2, y1);
                if(mp.count(p3) && mp.count(p4)) {
                    res.push_back(i);
                    res.push_back(j);
                    res.push_back(mp[p3]);
                    res.push_back(mp[p4]);
                    cout << "4" << endl;
                    sort(res.begin(), res.end());
                    for(int k = 0; k < 4; k++) {
                        cout << res[k] << endl;
                    }
                    return 0;
                }
            }
        }
    }
    cout << "0" << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Regular Polygon
User daisy8867
Language C++ (G++ 4.6.4)
Score 0
Code Size 1859 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:31:9: error: expected ‘;’ before ‘)’ token
./Main.cpp:35:1: error: ‘ost’ was not declared in this scope
./Main.cpp:35:4: error: expected ‘;’ before ‘)’ token