Submission #86999

#TimeUsernameProblemLanguageResultExecution timeMemory
86999YottaByteStar triangles (IZhO11_triangle)C++14
100 / 100
1043 ms15300 KiB
#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)

triangle.cpp:29:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...