CF A. Arrangement of RGB Balls
来源:互联网 发布:淘宝怎么搜不到东西了 编辑:程序博客网 时间:2024/06/07 05:27
题目:CF A. Arrangement of RGB Balls
思路:找规律
这题样例中已经把答案都给出来了,最大最小值之差大于等于2的肯定无解,0 1 1 和 0 0 1 需要特判,然后 a a a 是6种,a b b 和 a a b 都是2种
#include <cstring>#include <cstdio>#include <algorithm>#include <cmath>using namespace std;int a[3];int main(){ int mi,mx; int t; scanf("%d",&t); for(int cas=1;cas<=t;cas++) { mi=1000001,mx=-1; for(int i=0;i<3;i++) { scanf("%d",&a[i]); mi=min(mi,a[i]); mx=max(mx,a[i]); } if(mx-mi>=2) printf("0\n"); else { sort(a,a+3); if(a[0]==0) { if(a[1]==1 && a[2]==1) printf("2\n"); else if(a[1]==0 && a[2]==1) printf("1\n"); else printf("0\n"); } else if(a[0]==a[1] && a[2]==a[1]) printf("6\n"); else if(a[0]==a[1]) printf("2\n"); else if(a[1]==a[2]) printf("2\n"); else printf("0\n"); } } return 0;}
- CF A. Arrangement of RGB Balls
- CF 2013-2014CTS01E04(Arrangement of RGB Balls-RGBRGB..)
- CF 367C Sereja and the Arrangement of Numbers(欧拉路径)
- arrangement of number
- CF 455B-- A Lot of Games
- (CF) D. A Lot of Games
- CF 214 A System of Equations
- CF 553A. Kyoya and Colored Balls 组合数学 和dp有点关系
- Aligned arrangement of the "struct".
- HNU 12844 Arrangement of Contest
- Usage of CXQ's Arrangement
- Five Balls of Life
- CF 3A Shortest path of the king
- CF 396A On Number of Decompositions into Multipliers
- CF 396A On Number of Decompositions into Multipliers
- CF 455B(A Lot of Games-树上博弈)
- cf 3a Shortest path of the king
- 【31.42%】【CF 714A】Meeting of Old Friends
- JDK动态代理
- 创建精灵池
- 安卓editText换行控制符号筛选
- struts 2 result-types 备忘
- (续)为什么很多技术合伙人参与创业时会先谈钱?
- CF A. Arrangement of RGB Balls
- 如何利用反向代理提高网站性能
- 我的学习笔记之二——修改导入表HOOK API(ring3_iat_exe_hook_Messagebox)
- 子数据窗口回卷事件
- 一个80后程序员的转行创业日记7
- 深入认识javascript中的eval函数
- 没有密码怎样删除officescan
- Elf动态解析符号过程
- 如何确定一个机器的字节顺序是大端还是小端