# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1211771 | michael12 | Star triangles (IZhO11_triangle) | C++20 | 385 ms | 6936 KiB |
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int main(){
long long tt;
cin >> tt;
map<long long, long long> mp, mp1;
int ans[tt], ans1[tt];
for(long long i = 0; i < tt; i++){
cin >> ans[i] >> ans1[i];
mp[ans[i]]++;
mp1[ans1[i]]++;
}
long long s = 0;
for(long long i = 0; i < tt; i++){
s += (mp[ans[i]] - 1) * (mp1[ans1[i]] - 1);
}
cout << s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |