제출 #144377

#제출 시각아이디문제언어결과실행 시간메모리
144377Lawliet별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
547 ms13408 KiB
#include <bits/stdc++.h> #define MAX 300010 using namespace std; typedef long long int lli; int n; int x[MAX]; int y[MAX]; lli ans; map<int,lli> marcX; map<int,lli> marcY; int main() { scanf("%d",&n); for(int g = 1 ; g <= n ; g++) { scanf("%d %d",&x[g],&y[g]); marcX[ x[g] ]++; marcY[ y[g] ]++; } for(int g = 1 ; g <= n ; g++) ans += (marcX[ x[g] ] - 1)*(marcY[ y[g] ] - 1); printf("%lld\n",ans); }

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

triangle.cpp: In function 'int main()':
triangle.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
triangle.cpp:24:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&x[g],&y[g]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...