답안 #987149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
987149 2024-05-22T05:36:48 Z ezzzay 별들과 삼각형 (IZhO11_triangle) C++14
0 / 100
12 ms 14684 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
const int N=3e5+5;
 vector<int>v[N];
signed main(){
    int n;
    cin>>n;
    map<int,int>mpx,mpy;
   
    for(int i=1;i<=n;i++){
        int x,y;
        cin>>x>>y;
        mpx[x]++;
        mpy[y]++;
        v[x].pb(y);
    }
    int cnt=0;
    for(auto it=mpx.begin();it!=mpx.end();it++){
        int x= it->ff;
        for(auto y:v[x]){
            cnt+= (mpy[y]-1)*(mpx[x]-1);
        }
    }
    cout<<cnt;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7256 KB Output is correct
2 Correct 4 ms 7260 KB Output is correct
3 Correct 5 ms 7260 KB Output is correct
4 Correct 5 ms 7484 KB Output is correct
5 Runtime error 12 ms 14684 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -