hiho week 142 register

Ended

Participants:332

Verdict:Accepted
Score:100 / 100
Submitted:2017-03-20 19:54:34

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 <iostream>
#include <cstdio>
const int INF = 0x3f3f3f3f;
using namespace std;
struct point
{
    int x,y;
    point(int tx=0,int ty=0):x(tx),y(ty) {}
} p[1005];
bool isInteriorAngle(int id,int n)
{
    if(p[id].x > p[(id-1+n)%n].x && p[id].y < p[(id+1)%n].y)//
        return false;
    if(p[id].y > p[(id-1+n)%n].y && p[id].x > p[(id+1)%n].x)//
        return false;
    if(p[id].x < p[(id-1+n)%n].x && p[id].y > p[(id+1)%n].y)//
        return false;
    if(p[id].y < p[(id-1+n)%n].y && p[id].x < p[(id+1)%n].x)//
        return false;
    return true;
}
bool isInersect(point leftDown,point rightUp,int n)
{
    bool flag = true;
    for(int i = 0; i<n; i++)
    {
        if(p[i].x == p[(i+1)%n].x)
        {
            if(p[i].x <= leftDown.x || p[i].x >= rightUp.x||max(p[i].y,p[(i+1)%n].y) <= leftDown.y || min(p[i].y,p[(i+1)%n].y)>=rightUp.y)
                continue;
            else
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX