Submission #526056
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)(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));
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 |
1855 Byte |
Status |
WA |
Exec Time |
46 ms |
Memory |
1056 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 100 |
Status |
|
|
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 |
29 ms |
1056 KB |
subtask0_sample_02.txt |
AC |
27 ms |
952 KB |
subtask1_random01.txt |
AC |
45 ms |
956 KB |
subtask1_random02.txt |
AC |
45 ms |
1048 KB |
subtask1_random03.txt |
AC |
42 ms |
1048 KB |
subtask1_random04.txt |
AC |
42 ms |
1052 KB |
subtask1_random05.txt |
WA |
46 ms |
1052 KB |
subtask1_random06.txt |
WA |
29 ms |
952 KB |
subtask1_random07.txt |
AC |
44 ms |
952 KB |
subtask1_random08.txt |
AC |
45 ms |
956 KB |
subtask1_special01.txt |
AC |
25 ms |
1048 KB |
subtask1_special02.txt |
AC |
28 ms |
1048 KB |
subtask1_special03.txt |
AC |
26 ms |
1052 KB |
subtask1_special04.txt |
AC |
26 ms |
1052 KB |
subtask1_special05.txt |
AC |
40 ms |
1056 KB |
subtask1_special06.txt |
AC |
30 ms |
1048 KB |
subtask1_special07.txt |
AC |
28 ms |
1052 KB |
subtask1_special08.txt |
AC |
29 ms |
956 KB |
subtask1_special09.txt |
AC |
29 ms |
956 KB |
subtask1_special10.txt |
AC |
27 ms |
944 KB |