# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304156 | _Yo_S_iN_ | Star triangles (IZhO11_triangle) | C++17 | 971 ms | 9208 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<bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
ll n, m, x,cnt , a;
void solve(){
map<ll , ll>used , used1;
cin >> n;
ll arr[n] , b[n];
for( int i = 0;i < n;i ++ ){
cin >> arr[i] >> b[i];
used[arr[i]] ++;
used1[b[i]] ++;
}
for( int i = 0;i < n;i ++ ){
cnt+=(used[arr[i]] - 1) * (used1[b[i]] - 1);
}
cout << cnt;
}
int main(){
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |