# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
37260 | MrPlany | Star triangles (IZhO11_triangle) | C++14 | 646 ms | 21896 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Bismillahi-rahmani-rahim
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef map <int, int> mii;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const int inf=1e9;
#define azdar priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
#define Lebap ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define pf push_front
#define pk pop_back
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
//#include <conio.h>
#include <climits>
const int N = 1e6+9;
map<ll,int> X,Y;
ll n, x[N],y[N],ans=0;
int main(){
Lebap;
cin>>n;
for(int i=1;i<=n;i++){
cin>>x[i];
cin>>y[i];
X[x[i]]++;
Y[y[i]]++;
}
for(int i=1;i<=n;i++){
ans += (X[x[i]]-1)*(Y[y[i]]-1);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |