Submission #88467

# Submission time Handle Problem Language Result Execution time Memory
88467 2018-12-06T04:58:56 Z 1Khan Star triangles (IZhO11_triangle) C++14
0 / 100
2000 ms 784 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 b = 1; b <= n; ++b){
          for(int e = 1; e <= n; ++e){
               for(int u = 1; u <= n; ++u){
                    if(b != e && b != u && e != u){
                         int q = 0;
                         if(x[b] != x[e] && y[b] == y[e] && x[b] == x[u] && y[b] != y[u]){
                              q = 1;
                         }
                         if(x[b] != x[e] && y[b] == y[e] && x[e] == x[u] && y[e] != y[u]){
                              q = 1;
                         }
                         ans += q;
                    }

               }
          }
     }
     cout << ans / 2;
     return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 508 KB Output is correct
3 Correct 2 ms 508 KB Output is correct
4 Correct 2 ms 508 KB Output is correct
5 Correct 2 ms 536 KB Output is correct
6 Correct 2 ms 540 KB Output is correct
7 Correct 4 ms 560 KB Output is correct
8 Correct 21 ms 564 KB Output is correct
9 Correct 252 ms 676 KB Output is correct
10 Correct 688 ms 704 KB Output is correct
11 Correct 1415 ms 704 KB Output is correct
12 Execution timed out 2045 ms 784 KB Time limit exceeded
13 Halted 0 ms 0 KB -