首页 技术 正文
技术 2022年11月12日
0 收藏 641 点赞 2,989 浏览 821 个字
 #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 ;
}
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,083
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,558
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,407
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,180
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,817
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,900