# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1065592 | Malix | Star triangles (IZhO11_triangle) | C++14 | 382 ms | 13392 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>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;
typedef vector<ll> li;
typedef vector<li> lii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))
ll INF=1000000000000000010;
int inf=1e9+10;
ll M=1e9+7;
int main() {
int n;cin>>n;
map<int,ll> x,y;
vi a(n),b(n);
REP(i,0,n)cin>>a[i]>>b[i];
REP(i,0,n){
x[a[i]]++;
y[b[i]]++;
}
ll ans=0;
REP(i,0,n)ans+=(x[a[i]]-1)*(y[b[i]]-1);
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |