# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
692996 | ktkerem | Star triangles (IZhO11_triangle) | C++17 | 448 ms | 15544 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.
/*#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")/**/
#include<bits/stdc++.h>
//typedef int ll;
typedef long long ll;
typedef unsigned long long ull;
#define llll std::pair<ll , ll>
#define pb push_back
#define pf push_front
#define halo cout << "hello" << std::endl
#define fi first
#define sec second
#define all(a) a.begin() , a.end()
const ll limit = 1e18+7;
const ll ous = 2e5 + 500;
const ll dx[4] = {-1 , 0 , 1 , 0} , dy[4] = {0,1,0,-1};
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
ll n;
std::map<ll , ll> mpx , mpy;
std::vector<llll> ar;
void solve(){
std::cin >> n;
ar.resize(n);
for(ll i = 0 ; n>i;i++){
std::cin >> ar[i].fi >> ar[i].sec;
mpx[ar[i].fi]++;
mpy[ar[i].sec]++;
}
ll ans = 0;
for(ll i = 0;n>i;i++){
ans+=(mpx[ar[i].fi]-1) * (mpy[ar[i].sec]-1);
}
std::cout << ans << "\n";
return;/**/
}
signed main(){
//std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
ll t=1;
//std::cin >> t;
ll o = 1;
while(t--){
//std::cout << "Case " << o << ": ";
//o++;
solve();
}
return 0;
}/**/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |