CodeForces 617D Polyline

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CodeForces 617D Polyline相关的知识,希望对你有一定的参考价值。

无脑暴力判断。

#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<list>
#include<algorithm>
using namespace std;

struct point
{
    long long x;
    long long y;
}p1,p2,p3;

int main()
{
    scanf("%lld%lld",&p1.x,&p1.y);
    scanf("%lld%lld",&p2.x,&p2.y);
    scanf("%lld%lld",&p3.x,&p3.y);

    if(p1.x==p2.x&&p2.x==p3.x) printf("1\n");
    else if(p1.y==p2.y&&p2.y==p3.y) printf("1\n");
    else if(p1.y==p2.y&&(p3.x>=max(p1.x,p2.x)||p3.x<=min(p1.x,p2.x))) printf("2\n");
    else if(p3.y==p2.y&&(p1.x>=max(p3.x,p2.x)||p1.x<=min(p3.x,p2.x))) printf("2\n");
    else if(p1.y==p3.y&&(p2.x>=max(p1.x,p3.x)||p2.x<=min(p1.x,p3.x))) printf("2\n");
    else if(p1.x==p2.x&&(p3.y>=max(p1.y,p2.y)||p3.y<=min(p1.y,p2.y))) printf("2\n");
    else if(p3.x==p2.x&&(p1.y>=max(p3.y,p2.y)||p1.y<=min(p3.y,p2.y))) printf("2\n");
    else if(p1.x==p3.x&&(p2.y>=max(p1.y,p3.y)||p2.y<=min(p1.y,p3.y))) printf("2\n");
    else printf("3\n");
    return 0;
}

 

以上是关于CodeForces 617D Polyline的主要内容,如果未能解决你的问题,请参考以下文章

Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains 树状数组维护区间最大值(示(代

ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A Palindromic Supersequence(代

Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3) C. Stairs and Elevators二分查找(示例(代

Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A,B,C真的菜·(代

Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) BWeakened Common Diviso(代

ARCGIS 中polyline的Z M值如何批量修改