# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
601104 | kabika | 별들과 삼각형 (IZhO11_triangle) | C++14 | 501 ms | 20292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define x first
#define y second
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
map<int,vector<int>> xfx, yfx;
vector<pair<int,int>> st(n);
for(int i = 0; i < n; ++i)
{
cin >> st[i].x >> st[i].y;
xfx[st[i].x].push_back(st[i].y);
yfx[st[i].y].push_back(st[i].x);
}
ll ans = 0;
for(int i = 0; i < n; ++i)
{
ll t = (xfx[st[i].x].size() - 1)*(yfx[st[i].y].size() - 1);
//cout << t << '\n';
ans += t;
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |