# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86999 | YottaByte | Star triangles (IZhO11_triangle) | C++14 | 1043 ms | 15300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <iomanip>
#include <math.h>
#include <map>
using namespace std;
#define pb push_back
#define ins insert
#define fr first
#define sc second
const int pi = acos(0) * 2;
const int N = 3e5;
inline void FIXED() {
cout << fixed << setprecision(48);
}
inline double dist(int x1, int x2, int y1, int y2) {
return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
vector < pair < int, int > > dot;
map < int, vector < int > > vx;
map < int, vector < int > > vy;
map < int, bool > vis;
main()
{
int n, ans = 0;
cin >> n;
for(int i = 1; i <= n; i++)
{
int x, y;
cin >> x >> y;
dot.pb( {x, y} );
vx[x].pb(y);
vy[y].pb(x);
}
for(pair < int, int > i : dot)
{
//vis[i.fr] = 1;
//vis[i.sc] = 1;
ans += (vx[i.fr].size() - 1) * (vy[i.sc].size() - 1);
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |