BZOJ 2344: [Baltic2011]Icecream 暴力
来源:互联网 发布:京东和淘宝哪个厉害 编辑:程序博客网 时间:2024/05/20 10:54
2344: [Baltic2011]Icecream
Time Limit: 1 Sec Memory Limit: 256 MBSubmit: 279 Solved: 218
[Submit][Status][Discuss]
Description
现在有N种冰淇淋,TZ要吃他们。
由于TZ食量有限,他等下还要去吃若菜,所以他只吃3个。
然而因为TZ比较神,所以他觉得某两个冰淇淋不能一起吃。
一共有M组不能一起吃的冰淇淋。
TZ可以瞬间算出一共有多少中吃法([1,2,3]和[2,1,3]是同种),
你能吗?
n<=200,m<=10000
Input
Output
Sample Input
5 3
1 2
3 4
1 3
1 2
3 4
1 3
Sample Output
3
HINT
There are 5 flavors and 3 impossible pairings. Flavor 1 should be combined with neither flavor 2 nor
flavor 3, and flavor 3 also should not be chosen together with flavor 4. Only 3 ways to choose three
different flavors remain: (1 4 5), (2 3 5), and (2 4 5).
没有题解
我来造福人类
#include<cmath>#include<ctime>#include<cstdio>#include<cstring>#include<cstdlib>#include<iostream>#include<algorithm>#include<iomanip>#include<vector>#include<string>#include<bitset>#include<queue>#include<map>#include<set>using namespace std;inline int read(){int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch<='9'&&ch>='0'){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}return x*f;}void print(int x){if(x<0)putchar('-'),x=-x;if(x>=10)print(x/10);putchar(x%10+'0');}const int N=210;bool mp[N][N];int main(){int n=read(),m=read();register int i,j,k,x,y;for(i=1;i<=m;++i)x=read(),y=read(),mp[x][y]=mp[y][x]=1;int ans=0;for(i=1;i<=n;++i)for(j=i+1;j<=n;++j)for(k=j+1;k<=n;++k)if(!mp[i][j]&&!mp[i][k]&&!mp[j][k])ans++;cout<<ans<<endl;}/*5 31 23 41 33*/
阅读全文
0 0
- BZOJ 2344: [Baltic2011]Icecream 暴力
- bzoj 1199 二分暴力
- BZOJ 4352: Tower|暴力
- bzoj 3916 暴力+hash
- BZOJ 2120 数颜色 暴力
- bzoj 1024 生日快乐 暴力搜索
- BZOJ 3045 电话线路 暴力
- BZOJ 3251 树上三角形 暴力
- BZOJ 1024: [SCOI2009]生日快乐|暴力
- BZOJ 3713: [PA2014]Iloczyn|暴力
- 【bzoj 3190】: [JLOI2013]赛车 暴力
- [暴力] BZOJ 3917 [Baltic2014]sequence
- bzoj 1293: [SCOI2009]生日礼物 暴力
- 【BZOJ 3251】树上三角形 暴力
- 【BZOJ 2079】[Poi2010]Guilds 暴力
- [暴力] BZOJ 2901 矩阵求和
- [BZOJ]1810: [Ioi2005]gar 暴力
- bzoj 3251: 树上三角形 暴力
- noteBook2.6-C#基础第六天
- [最小割]BZOJ 1497——[NOI2006]最大获利
- Opencv 日志文件函数书写
- ssm工作原理
- 171014系统日志、日志同步
- BZOJ 2344: [Baltic2011]Icecream 暴力
- java设计模式——单例模式
- NLP常用数据集
- STM32串口实现485双机通信原理
- 快速幂求法(二进制求解)java实现
- angularJS错误及其解决办法集
- 微信支付之微信内H5调起支付
- java 选择排序
- Crontab 命令详解