编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#2670 #1003. 凸多边形 Accepted 100 190 ms 508 K C++ 17 (Clang) / 892 B s230026023 2023-11-20 17:59:21
显示原始代码
#include <stdio.h>
#include <iostream>

using namespace std;
int main() {
    // A=y2-y1,B=X1-x2,C=X2*Y1-X1*Y2
    // 0=Ax+By+c
    struct point {
        int x;
        int y;
    };
    struct line {
        int A;
        int B;
        int C;
    };
    struct point p[4];
    for (int i = 0; i < 4; i++) {
        cin >> p[i].x >> p[i].y;
    }
    struct line l[2];
    for (int i = 0; i < 2; i++) {
        l[i].A = p[i + 2].y - p[i].y;
        l[i].B = p[i].x - p[i + 2].x;
        l[i].C = p[i + 2].x * p[i].y - p[i].x * p[i + 2].y;
    }
    // p1,p2 insert Ax+By+c,the answer all positive or negative,the two point in the similar side of line
    int verfiy = 1;
    for (int i = 0; i < 4; i = i + 2) {
        verfiy = (p[i].x * l[1].A + p[i].y * l[1].B + l[1].C) * verfiy;
    }
    if (verfiy > 0) {
        cout << "No";
        return 0;
    }
    verfiy = 1;
    for (int i = 1; i < 4; i = i + 2) {
        verfiy = (p[i].x * l[0].A + p[i].y * l[0].B + l[0].C) * verfiy;
    }
    if (verfiy > 0) {
        cout << "No";
        return 0;
    }
    cout << "Yes";
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:6 ms
内存:300 KiB

输入文件(random_01.in

-52 -52
-61 -76
-2 -54
14 -11

答案文件(random_01.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:6 ms
内存:364 KiB

输入文件(sample_01.in

0 0
1 0
1 1
0 1

答案文件(sample_01.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:5 ms
内存:352 KiB

输入文件(random_02.in

42 -44
71 -31
66 -32
9 -51

答案文件(random_02.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:6 ms
内存:280 KiB

输入文件(sample_02.in

0 0
1 1
-1 0
1 -1

答案文件(sample_02.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:7 ms
内存:268 KiB

输入文件(random_03.in

86 -52
7 88
25 -14
90 -62

答案文件(random_03.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:5 ms
内存:356 KiB

输入文件(random_04.in

16 80
8 -18
93 -37
34 64

答案文件(random_04.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:6 ms
内存:288 KiB

输入文件(random_05.in

-70 -28
1 -95
100 6
63 31

答案文件(random_05.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:6 ms
内存:276 KiB

输入文件(random_06.in

91 -78
75 52
25 93
4 -87

答案文件(random_06.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:5 ms
内存:392 KiB

输入文件(random_07.in

17 61
-75 93
100 -50
61 38

答案文件(random_07.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:5 ms
内存:480 KiB

输入文件(random_08.in

-3 42
-19 7
67 -59
86 45

答案文件(random_08.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #11
Accepted
得分:100
用时:7 ms
内存:384 KiB

输入文件(random_09.in

19 -82
98 -82
16 87
2 -6

答案文件(random_09.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #12
Accepted
得分:100
用时:6 ms
内存:284 KiB

输入文件(random_10.in

-64 -57
43 3
-67 -14
-65 -44

答案文件(random_10.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #13
Accepted
得分:100
用时:6 ms
内存:308 KiB

输入文件(random_11.in

72 88
-16 78
-14 -22
99 -13

答案文件(random_11.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #14
Accepted
得分:100
用时:6 ms
内存:384 KiB

输入文件(random_12.in

-75 92
-40 11
41 -91
-11 92

答案文件(random_12.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #15
Accepted
得分:100
用时:5 ms
内存:384 KiB

输入文件(random_13.in

-22 -57
12 -96
97 30
-72 38

答案文件(random_13.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #16
Accepted
得分:100
用时:3 ms
内存:256 KiB

输入文件(random_14.in

40 -43
61 77
-33 54
-39 -1

答案文件(random_14.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #17
Accepted
得分:100
用时:5 ms
内存:348 KiB

输入文件(random_15.in

79 56
-77 55
-57 -12
64 -81

答案文件(random_15.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #18
Accepted
得分:100
用时:5 ms
内存:352 KiB

输入文件(random_16.in

-77 36
-17 -45
77 -89
73 5

答案文件(random_16.out

Yes

用户输出

Yes

系统信息

Exited with return code 0
测试点 #19
Accepted
得分:100
用时:5 ms
内存:272 KiB

输入文件(random_17.in

35 -4
48 -62
92 72
-36 39

答案文件(random_17.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #20
Accepted
得分:100
用时:5 ms
内存:284 KiB

输入文件(random_18.in

16 95
7 76
-83 55
50 -93

答案文件(random_18.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #21
Accepted
得分:100
用时:6 ms
内存:296 KiB

输入文件(random_19.in

-21 -7
7 80
-95 -6
-23 -73

答案文件(random_19.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #22
Accepted
得分:100
用时:7 ms
内存:508 KiB

输入文件(random_20.in

54 -33
-87 -89
27 -83
62 -98

答案文件(random_20.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #23
Accepted
得分:100
用时:5 ms
内存:272 KiB

输入文件(random_21.in

-68 -27
83 -90
84 58
-6 1

答案文件(random_21.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #24
Accepted
得分:100
用时:6 ms
内存:348 KiB

输入文件(random_22.in

-15 -42
-45 1
-48 -18
-89 -65

答案文件(random_22.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #25
Accepted
得分:100
用时:6 ms
内存:384 KiB

输入文件(random_23.in

87 -82
-84 -11
-28 -62
-19 -84

答案文件(random_23.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #26
Accepted
得分:100
用时:4 ms
内存:384 KiB

输入文件(random_24.in

-65 77
28 -73
25 29
73 61

答案文件(random_24.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #27
Accepted
得分:100
用时:5 ms
内存:276 KiB

输入文件(random_25.in

-82 -90
100 -6
59 36
36 88

答案文件(random_25.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #28
Accepted
得分:100
用时:6 ms
内存:348 KiB

输入文件(random_26.in

2 -3
86 60
-97 80
-29 -85

答案文件(random_26.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #29
Accepted
得分:100
用时:6 ms
内存:308 KiB

输入文件(random_27.in

-3 91
-59 48
51 -44
37 -21

答案文件(random_27.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #30
Accepted
得分:100
用时:4 ms
内存:276 KiB

输入文件(random_28.in

-21 98
-56 12
63 34
12 55

答案文件(random_28.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #31
Accepted
得分:100
用时:7 ms
内存:372 KiB

输入文件(random_29.in

-68 0
-64 -39
39 43
-87 68

答案文件(random_29.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #32
Accepted
得分:100
用时:6 ms
内存:380 KiB

输入文件(random_30.in

80 -98
-25 53
-40 -11
-81 -23

答案文件(random_30.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #33
Accepted
得分:100
用时:5 ms
内存:508 KiB

输入文件(random_31.in

-6 37
-20 47
-73 1
61 -8

答案文件(random_31.out

No

用户输出

No

系统信息

Exited with return code 0
测试点 #34
Accepted
得分:100
用时:7 ms
内存:508 KiB

输入文件(random_32.in

51 62
-10 30
27 20
31 10

答案文件(random_32.out

No

用户输出

No

系统信息

Exited with return code 0