| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 975869 | vjudge1 | 별들과 삼각형 (IZhO11_triangle) | C++17 | 205 ms | 11808 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
unordered_map<int, int> xCount, yCount;
vector<pair<int, int>> points(N);
for (int i = 0; i < N; ++i) {
int x, y;
cin >> x >> y;
points[i] = make_pair(x, y);
xCount[x]++;
yCount[y]++;
}
long long totalCount = 0;
for (auto point : points) {
int x = point.first;
int y = point.second;
int sameX = xCount[x];
int sameY = yCount[y];
totalCount += (long long)(sameX - 1) * (sameY - 1);
}
cout << totalCount << endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
