# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
173456 | super_j6 | Fences (JOI18_fences) | C++14 | 74 ms | 1784 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;
#define endl '\n'
#define pi pair<int, int>
int cp(long long x, long long y, int X, int Y){
return x * Y == X * y ? 0 : x * Y < X * y ? -1 : 1;
}
int il(int x1, int y1, int X1, int Y1, int x2, int y2, int X2, int Y2){
int a = cp(X1 - x1, Y1 - y1, x2 - x1, y2 - y1);
int b = cp(X1 - x1, Y1 - y1, X2 - x1, Y2 - y1);
int c = cp(X2 - x2, Y2 - y2, x1 - x2, y1 - y2);
int d = cp(X2 - x2, Y2 - y2, X1 - x2, Y1 - y2);
return a && b && c && d && a != b && c != d;
}
const int maxn = 408, p = 1000000007;
int n, s, m;
int a[maxn], b[maxn];
double dp[maxn][maxn];
int gc(int x, int y, int X, int Y){
return il(x, y, X, Y, 0, 0, p, 1) ? cp(x, y, p, 1) : 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |