제출 #344249

#제출 시각아이디문제언어결과실행 시간메모리
344249katearima별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
671 ms12396 KiB
#include <bits/stdc++.h>
#define ss second
#define ff first
using namespace std;
const int N=3e5+10;
int n, x[N], y[N], ans;
map<int, int> fx, fy;
main(){
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>x[i]>>y[i];
        fx[x[i]]++;
        fy[y[i]]++;
    }
    for(int i=0; i<n; i++){
        ans+=(fx[x[i]]-1)*(fy[y[i]]-1);
    }
    cout<<ans<<endl;



}

컴파일 시 표준 에러 (stderr) 메시지

triangle.cpp:8:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...