MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | TLE
Submitted:2015-05-09 16:36:43

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
#define LL long long
using namespace std;
const int N = 110;
const double eps = 1e-6;
int x[N], y[N], a[N], b[N], t[N], tn;
int n, m, g, p;
double area3 (double x1, double y1, double x2, double y2, double x3, double y3) {
    return fabs (0.5 * ((y3 - y1) * (x2 - x1) - (y2 - y1) * (x3 - x1)));
}
int jug (int a, int b) {
    for (int i = 0; i < tn; i++) {
        for (int j = i + 1; j < tn; j++) {
            for (int k = j + 1; k < tn; k++) {
                double a0 = area3 (x[t[i]], y[t[i]], x[t[j]], y[t[j]], x[t[k]], y[t[k]]);
                double a1 = area3 (a, b, x[t[j]], y[t[j]], x[t[k]], y[t[k]]);
                double a2 = area3 (x[t[i]], y[t[i]], a, b, x[t[k]], y[t[k]]);
                double a3 = area3 (x[t[i]], y[t[i]], x[t[j]], y[t[j]], a, b);
//                cout << t[i] << ' ' << t[j] << ' ' << t[k] << endl;
//                cout << a0 << ' ' << a1 << ' ' << a2 << ' ' << a3 << endl;
                if (fabs (a1 + a2 + a3 - a0) < eps) return 1;
            }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX