Submission #526051


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;
    int64 x, y;
    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;
        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++) {
            int64 p1 = pts[i - 1], p2 = pts[j - 1];
            int x1 = (int)((p1 & pre) >> 32), y1 = (int)(p1 & post), x2 = (int)((p2 & pre) >> 32), y2 = (int)(p2 & 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 & post));
                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 1576 Byte
Status WA
Exec Time 39 ms
Memory 932 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 2
AC × 18
WA × 2
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_random01.txt, subtask1_random02.txt, subtask1_random03.txt, subtask1_random04.txt, subtask1_random05.txt, subtask1_random06.txt, subtask1_random07.txt, subtask1_random08.txt, subtask1_special01.txt, subtask1_special02.txt, subtask1_special03.txt, subtask1_special04.txt, subtask1_special05.txt, subtask1_special06.txt, subtask1_special07.txt, subtask1_special08.txt, subtask1_special09.txt, subtask1_special10.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt AC 23 ms 796 KB
subtask0_sample_02.txt AC 22 ms 928 KB
subtask1_random01.txt AC 39 ms 800 KB
subtask1_random02.txt AC 39 ms 804 KB
subtask1_random03.txt AC 39 ms 800 KB
subtask1_random04.txt AC 39 ms 856 KB
subtask1_random05.txt WA 26 ms 804 KB
subtask1_random06.txt WA 27 ms 928 KB
subtask1_random07.txt AC 38 ms 920 KB
subtask1_random08.txt AC 38 ms 876 KB
subtask1_special01.txt AC 24 ms 836 KB
subtask1_special02.txt AC 22 ms 796 KB
subtask1_special03.txt AC 24 ms 924 KB
subtask1_special04.txt AC 24 ms 796 KB
subtask1_special05.txt AC 35 ms 924 KB
subtask1_special06.txt AC 28 ms 928 KB
subtask1_special07.txt AC 25 ms 800 KB
subtask1_special08.txt AC 28 ms 932 KB
subtask1_special09.txt AC 26 ms 928 KB
subtask1_special10.txt AC 25 ms 804 KB