답안 #88466

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
88466 2018-12-06T04:48:48 Z 1Khan 별들과 삼각형 (IZhO11_triangle) C++14
0 / 100
2 ms 512 KB
// In the name of GOD

#include <bits/stdc++.h>

using namespace std;

#define good exit(0);
#define nl endl
#define ios ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define pb push_back
#define bb begin()
#define ee end()
#define ff first
#define ss second
#define ll long long
#define db double
#define pii pair<int, int>

const int N = 3e5 + 555;

int n;
int x[11111], y[11111];
int ans;
int main(){

     ios

     cin >> n;
     for(int i = 1; i <= n; ++i){
          cin >> x[i] >> y[i];
     }
     for(int i = 1; i <= n; ++i){
          for(int j = i + 1; j <= n; ++j){
               for(int l = j + 1; j <= n; ++j){
                    int q = 0;
                    if(x[i] != x[j] && x[i] == x[l] && y[i] == y[j] && y[i] != y[l]){
                         q = 1;
                    }
                    if(x[i] != x[l] && x[i] == x[j] && y[i] == y[l] && y[i] != y[j]){
                         q = 1;
                    }
                    if(x[l] != x[j] && x[l] == x[i] && y[l] == y[j] && y[l] != y[i]){
                         q = 1;
                    }
                    ans += q;
               }
          }
     }
     cout << ans;
     return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Incorrect 2 ms 512 KB Output isn't correct
5 Halted 0 ms 0 KB -