Submission #526021


Source Code Expand

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

typedef long long int64;

int main() {
    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) | (y & ((1L << 32) - 1)));
//      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]; 
            int64 x1 = p1 >> 32, y1 = p1 & ((1L << 32) - 1L), x2 = p2 >> 32, y2 = p2 & ((1L << 32) - 1L);
//          cout << x1 << ", " << y1 << " " << x2 << ", " << y2 << endl;
            if(x1 != x2 && y1 != y2) {
                int64 p3 = ((x1 << 32) | (y2 & ((1L << 32) - 1))), p4 = ((x2 << 32) | (y1 & ((1L << 32) - 1)));
                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 1487 Byte
Status WA
Exec Time 46 ms
Memory 1052 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 28 ms 952 KB
subtask0_sample_02.txt AC 25 ms 1044 KB
subtask1_random01.txt AC 43 ms 1048 KB
subtask1_random02.txt AC 42 ms 1040 KB
subtask1_random03.txt AC 46 ms 952 KB
subtask1_random04.txt AC 42 ms 1044 KB
subtask1_random05.txt WA 30 ms 1040 KB
subtask1_random06.txt WA 31 ms 952 KB
subtask1_random07.txt AC 42 ms 1048 KB
subtask1_random08.txt AC 42 ms 1048 KB
subtask1_special01.txt AC 25 ms 952 KB
subtask1_special02.txt AC 26 ms 1052 KB
subtask1_special03.txt AC 27 ms 1044 KB
subtask1_special04.txt AC 26 ms 1052 KB
subtask1_special05.txt AC 41 ms 948 KB
subtask1_special06.txt AC 32 ms 1052 KB
subtask1_special07.txt AC 30 ms 952 KB
subtask1_special08.txt AC 32 ms 1052 KB
subtask1_special09.txt AC 28 ms 1052 KB
subtask1_special10.txt AC 27 ms 1052 KB