# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
874965 | SevakYegoryan | 별들과 삼각형 (IZhO11_triangle) | C++17 | 255 ms | 13336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <iterator>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <cassert>
#include <limits>
#include <climits>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define cdap(k) cout.setf(ios::fixed | ios::showpoint); cout.precision(k);
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb push_back
#define ff first
#define ss second
#define mkp make_pair
#define mkt make_tuple
#define pque priority_queue
const int INF = INT_MAX;
const long long LNF = LLONG_MAX;
const int N = 300003;
int x[N], y[N];
int n;
map<int, ll> mpx, mpy;
void solve()
{
int i, j;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
mpx[x[i]]++;
mpy[y[i]]++;
}
ll ans = 0LL;
for (i = 1; i <= n; i++) {
ans += (mpx[x[i]] - 1LL) * (mpy[y[i]] - 1LL);
}
cout << ans << "\n";
return;
}
int main()
{
fastIO;
int mt = 1;
//cin >> mt;
while(mt--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |