# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
671103 | 2022-12-12T03:11:13 Z | gavgav | 별들과 삼각형 (IZhO11_triangle) | C++17 | 272 ms | 12160 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long struct point{ int x, y; }; int main(){ int pointsNumber; scanf("%d", &pointsNumber); point points[pointsNumber]; map <int, int> pointsInRow, pointsInColumn; for (int i = 0; i < pointsNumber; ++i){ scanf("%d%d", &(points[i].x), &(points[i].y)); ++pointsInRow[points[i].y]; ++pointsInColumn[points[i].x]; } ll trianglesNumber = 0; for (int i = 0; i < pointsNumber; ++i){ trianglesNumber += (pointsInColumn[points[i].x] - 1) * (pointsInRow[points[i].y] - 1); } printf("%lld", trianglesNumber); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 296 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 7 ms | 980 KB | Output is correct |
13 | Correct | 6 ms | 956 KB | Output is correct |
14 | Correct | 9 ms | 1336 KB | Output is correct |
15 | Correct | 93 ms | 6116 KB | Output is correct |
16 | Correct | 100 ms | 6424 KB | Output is correct |
17 | Correct | 94 ms | 6032 KB | Output is correct |
18 | Correct | 93 ms | 6048 KB | Output is correct |
19 | Correct | 253 ms | 11512 KB | Output is correct |
20 | Correct | 181 ms | 9164 KB | Output is correct |
21 | Correct | 270 ms | 12160 KB | Output is correct |
22 | Correct | 272 ms | 12108 KB | Output is correct |