博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Gym 100342C Problem C. Painting Cottages 暴力
阅读量:6805 次
发布时间:2019-06-26

本文共 2371 字,大约阅读时间需要 7 分钟。

Problem C. Painting Cottages

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/gym/100342/attachments

Description

The new cottage settlement is organized near the capital of Flatland. The construction company that is building the settlement has decided to paint some cottages pink and others — light blue. However, they cannot decide which cottages must be painted which color. The director of the company claims that the painting is nice if there is at least one pink cottage, at least one light blue cottage, and it is possible to draw a straight line in such a way that pink cottages are at one side of the line, and light blue cottages are at the other side of the line (and no cottage is on the line itself). The main architect objects that there are several possible nice paintings.

Help them to find out how many different nice paintings are there

Input

The first line of the input file contains n — the number of the cottages (1 ≤ n ≤ 300). The following n lines contain the coordinates of the cottages — each line contains two integer numbers xi and yi (−104 ≤ xi , yi ≤ 104 ).

Output

Output one integer number — the number of different nice paintings of the cottages.

Sample Input

4

0 0
1 0
1 1
0 1

Sample Output

12

HINT

 

题意

给你一个二维图,然后上面有几个点,然后让你用一条线把这些点分开,问你最多有多少种分开的方式

题解

题意转化一下,就是这个n个点,能够连多少个不同的线段就好了,感觉是签到题……

数据范围才300

代码:

//qscqesze#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef long long ll;using namespace std;//freopen("D.in","r",stdin);//freopen("D.out","w",stdout);#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)#define maxn 200001#define mod 10007#define eps 1e-9int Num;char CH[20];//const int inf=0x7fffffff; //нчоч╢Сconst int inf=0x3f3f3f3f;inline ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}//**************************************************************************************struct node{ double x,y;};int gcd(int x,int y){ return y==0?x:gcd(y,x%y);}map< pair
,int> H;node a[maxn];int main(){ freopen("cottages.in","r",stdin); freopen("cottages.out","w",stdout); int n=read(); for(int i=0;i
>a[i].x>>a[i].y; int ans=0; for(int i=0;i

 

转载地址:http://hhjwl.baihongyu.com/

你可能感兴趣的文章
java调用cmd命令并捕获执行结果字符串的代码
查看>>
Eclipse中android sdk升级ADT版本过低解决办法
查看>>
MDT 2013 从入门到精通之无法分析或处理pass[specialize]文件
查看>>
桌面支持--512-Rear chassis fan not detected
查看>>
Django 开源相册组件介绍 django-photologue
查看>>
IntelliJ IDEA 14 创建Web项目
查看>>
Redis server命令
查看>>
【云计算的1024种玩法】手把手教你如何编译升级 OpenResty
查看>>
Mac Appium环境安装
查看>>
android源码分享,布局切换微信提醒对话框下拉刷新Cell进度动画代码下载
查看>>
Hello world!
查看>>
Solidity 函数returns多个值的接收方式 总结
查看>>
基于PCDN技术的无延时直播方案
查看>>
七周二次课
查看>>
安装版JDK后,修改环境变量,也无法生效的原因和解决办法
查看>>
springmvc源码解析MvcNamespaceHandler之<mvc:resources/>
查看>>
希尔排序就这么简单
查看>>
区块链100讲:Solidity语法的重载,继承的定义
查看>>
[HBase] LSM树 VS B+树
查看>>
当移动数据分析需求遇到Quick BI
查看>>