| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 88620 | toloraia | 별들과 삼각형 (IZhO11_triangle) | C++17 | 808 ms | 7520 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
//#define temo
using namespace std;
const int N = 300007;
map < int, int > M1, M2;
int n;
int x[N], y[N];
ll ans;
int main()
{
cin>>n;
for (int i = 1; i <= n; i++){
cin>>x[i]>>y[i];
M1[x[i]]++;
M2[y[i]]++;
}
for (int i = 1; i <= n; i++){
ll p = M1[x[i]] - 1;
ll q = M2[y[i]] - 1;
ans += p * q;
}
cout<<ans<<endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
