답안 #53661

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
53661 2018-06-30T16:07:11 Z sven 별들과 삼각형 (IZhO11_triangle) C++14
0 / 100
2 ms 720 KB
#include <bits/stdc++.h>
using namespace std;
long long  h[100001LL];
long long  v[100001LL];
int main()
{
   long long  nb;
   cin>>nb;
   long long tab[nb][2LL];
   for (long long i=0LL;i<nb;i+=1LL)
   {
      cin>>tab[i][0LL]>>tab[i][1LL];
      h[tab[i][0LL]]+=1LL;
      v[tab[i][1LL]]+=1LL;
   }
   long long  total=0LL;
   for (long long  i=0LL;i<nb;i+=1LL)
   {
      long long  in=((h[tab[i][0LL]]-1LL)*(v[tab[i][1LL]]-1LL));
      if (in>0LL)
         total+=in;
   }
   cout<<total;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 2 ms 600 KB Output is correct
4 Correct 2 ms 720 KB Output is correct
5 Incorrect 2 ms 720 KB Output isn't correct
6 Halted 0 ms 0 KB -