| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 212870 | islingr | 별들과 삼각형 (IZhO11_triangle) | C++14 | 360 ms | 12456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b) - 1; i >= (a); --i)
#define trav(x, v) for (auto &x : v)
#define ff first
#define ss second
using ll = int64_t;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
vector<pair<int, int>> v(n);
map<int, int> x, y;
trav(p, v) {
cin >> p.ff >> p.ss;
++x[p.ff]; ++y[p.ss];
}
ll ans = 0;
trav(p, v) ans += 1ll * (x[p.ff] - 1) * (y[p.ss] - 1);
cout << ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
