답안 #676198

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
676198 2022-12-29T19:46:55 Z Toxtaq 별들과 삼각형 (IZhO11_triangle) C++17
0 / 100
2000 ms 3980 KB
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int>x(n), y(n);
    map<int, int>X, Y;
    for(int i = 0;i < n;++i){
        cin >> x[i] >> y[i];
        X[x[i]]++;
        Y[y[i]]++;
    }
    int result = 0;
    for(int i = 0;i < n;++i){
        if(Y[y[i]] < 2)continue;
        Y[y[i]]--;
        for(int j = i + 1;j < n;++j){
            if(y[i] == y[j])result += X[x[i]] + X[x[j]] - 2;
        }
    }
    cout << result;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 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 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 5 ms 212 KB Output is correct
11 Correct 7 ms 340 KB Output is correct
12 Correct 13 ms 724 KB Output is correct
13 Correct 1177 ms 828 KB Output is correct
14 Correct 21 ms 1108 KB Output is correct
15 Execution timed out 2082 ms 3980 KB Time limit exceeded
16 Halted 0 ms 0 KB -