제출 #546318

#제출 시각아이디문제언어결과실행 시간메모리
546318krit3379별들과 삼각형 (IZhO11_triangle)C++17
100 / 100
388 ms13204 KiB
#include<bits/stdc++.h> using namespace std; #define N 300005 int x[N],y[N]; long long ans; map<int,long long> mpx,mpy; int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d %d",&x[i],&y[i]); mpx[x[i]]++; mpy[y[i]]++; } for(i=1;i<=n;i++){ ans+=(mpx[x[i]]-1)*(mpy[y[i]]-1); } printf("%lld",ans); return 0; }

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

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