Submission #1219528

#TimeUsernameProblemLanguageResultExecution timeMemory
1219528theiuliusStar triangles (IZhO11_triangle)C++20
100 / 100
463 ms20132 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define int long long #define ff first #define ss second #define pb push_back int n; const int N = 2e5+5; main(){ /*ifstream cin(".in"); ofstream cout(".out");*/ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; map<int, vector<int>> xs, ys; int x[n] = {}, y[n] = {}; for (int i = 0; i < n; i++){ cin >> x[i] >> y[i]; xs[y[i]].pb(x[i]); ys[x[i]].pb(y[i]); } int ans = 0; for (int i = 0; i < n; i++){ ans += (xs[y[i]].size() - 1) * (ys[x[i]].size() - 1); } cout << ans << endl; }

Compilation message (stderr)

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