# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
976553 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 390 ms | 14260 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <map>
#include <cstring>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll n; cin >> n;
map <ll, ll> row, col;
vector<pair<ll, ll>> titik;
for (ll i = 0; i < n; i++) {
ll r, c; cin >> r >> c;
titik.push_back({ r, c });
row[r]++;
col[c]++;
}
ll sum = 0;
//JANGAN LUPA KURANGIN SATU!
for (auto i : titik) {
ll total_r = row[i.first] - 1;
ll total_c = col[i.second] - 1;
sum = sum + (total_r * total_c);
}
cout << sum << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |