#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <string>
#include <map>
#include <cmath>
#include <vector> #define Faster ios::sync_with_stdio(false),cin.tie(0)
#define Read freopen("in.txt","r",stdin),freopen("out.txt","w",stdout)
#define Close fclose(stdin),fclose(stdout)
const int maxn = 1e5 + ;
using namespace std;
const int MOD = 1e9+;
typedef long long ll; const double eps = 1e-;
#define _sign(x)((x)>eps?1:((x)<-eps?2:0)) struct point
{
double x,y;
}p[maxn]; double xmult(point p1,point p2,point p0) {
return(p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);
} int is_convex(int n) {
int i,s[]={,,};
for (i=;i<n&&s[]|s[];i++)
s[_sign(xmult(p[(i+)%n],p[(i+)%n],p[i]))] = ;
return s[]|s[];
} int main(){
Faster;
int n;
while(cin >> n){
if(n == )
break;
for(int i = ;i < n;i++){
cin >> p[i].x >> p[i].y;
}
if(is_convex(n)){
cout << "convex" << endl;
}
else
cout << "concave" << endl;
}
return ;
}

hdu 2108 Shape of HDU(判定是不是凸多边形)的更多相关文章

  1. hdu 2108 Shape of HDU【判断多边形是否是凸多边形模板】

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=2108 http://acm.hust.edu.cn/vjudge/contest/view.action ...

  2. hdu 2108:Shape of HDU(计算几何,判断多边形是否是凸多边形,水题)

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  3. hdu 2108 Shape of HDU 判断是否为凸多边形

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Pro ...

  4. HDU 2108 Shape of HDU (判断是不是凸多边形 叉乘)

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  5. hdu 2108 Shape of HDU (数学)

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  6. HDU 2108 Shape of HDU

    题解:按照输入顺序依次将点连接起来,对于连续的三个点p0,p1,p2,令向量a=p1-p0,b=p2-p1 若是凸多边形,那么b相对于a一定是向逆时针方向旋转的 判断两向量的旋转方向,可以使用向量的叉 ...

  7. Hdoj 2108.Shape of HDU 题解

    Problem Description 话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,"徐队"的称呼逐渐被"徐总"所取代,海东 ...

  8. 【计算几何初步-判断是否凸多边形】【HDU2108】Shape of HDU

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tot ...

  9. *HDU 2108 计算几何

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

随机推荐

  1. [RK3288][Android6.0] 调试笔记 --- 软硬键盘同时使用【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/78748313 Platform: RK3288 OS: Android 6.0 Kernel ...

  2. 如何把wecenter的推荐的问题模块单独调取出来?

    查阅文档: http://wenda.wecenter.com/question/1893 http://www.zhidiu.com/article/1012 http://wenda.wecent ...

  3. webstorm代码提示按键改为alt+/

    webstorm代码提示默认按键为ctrl+空格 但是windows输入法中英文输入法的默认按键也是ctrl+空格 这就导致webstorm按键冲突,无法使用代码快捷提示按键 解决方法: 按ctrl+ ...

  4. 使用TextTest来做认定测试——本质是通过diff对比程序的运行log输出,来看测试结果和预期结果是否相同

    Welcome to TextTest.org! TextTest is an open source tool for text-based functional testing. This mea ...

  5. YCSB-mapkeer-leveldb实测

    使用thrift0.8.0编译好java版的mapkeeper并安装到ycsb下,使用thrift0.9.2编译好c++版的mapkeeper并编译leveldb客户端运行. 测试成功.recordc ...

  6. im资源

    https://github.com/oikomi/FishChatServer https://github.com/subrosa-io https://github.com/WhisperSys ...

  7. hdu-5358 First One(尺取法)

    题目链接: First One Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Other ...

  8. linux文件查找(find,locate)

    文件查找: locate:       非实时,模糊匹配,查找是根据全系统文件数据库进行的: # updatedb, 手动生成文件数据库 速度快   find:       实时       精确   ...

  9. C++之构造函数、参数列表、析构函数

    参考自:https://blog.csdn.net/sunSHINEEzy/article/details/78122485 构造函数之默认构造函数(调用的构造函数不用传递参数) 两种实例化方式都是默 ...

  10. 51nod1228

    伯努利数 这个是答案 其中的b是伯努利数,可以n^2预处理 伯努利数n^2递推 #include<bits/stdc++.h> using namespace std; typedef l ...