Codeforces 1191B Tokitsukaze and Mahjong
题目链接:http://codeforces.com/problemset/problem/1191/B


题意:类似于麻将,三个一样花色一样数字的,或者三个同花顺就赢了,新抽的能当任何类型,问至少几个。
思路:分类判断即可。
AC代码:
#include<bits/stdc++.h>
using namespace std;
bool check(int x,int y,int z)
{
if(x == (y + z) / && abs(y-z) == ) return true;
if(y == (x + z) / && abs(x-z) == ) return true;
if(z == (y + x) / && abs(y-x) == ) return true;
return false;
}
int main()
{
string a,b,c;
cin >> a >> b >> c;
int x = a[] - '';
int y = b[] - '';
int z = c[] - '';
if(a[] == b[] && b[] == c[])
{
if((x == y && y == z )|| check(x,y,z)) cout << << endl;
else if(abs(x-y) <= || abs(z-y) <= || abs(x-z) <= ) cout << << endl;
else cout << << endl;
}
else if(a[] == b[])
{
if(x == y || abs(x-y) <= ) cout << << endl;
else cout << << endl;
}
else if(b[] == c[])
{
if(z == y || abs(z-y) <= ) cout << << endl;
else cout << << endl;
}
else if(a[] == c[])
{
if(x == z || abs(x-z) <= ) cout << << endl;
else cout << << endl;
}
else cout << << endl;
return ;
}
Codeforces 1191B Tokitsukaze and Mahjong的更多相关文章
- Codeforces - 1191B - Tokitsukaze and Mahjong - 模拟
https://codeforces.com/contest/1191/problem/B 小心坎张听的情况. #include<bits/stdc++.h> using namespac ...
- Codeforces Round #573 (Div. 2) Tokitsukaze and Mahjong 水题
B. Tokitsukaze and Mahjong time limit per test1 second memory limit per test256 megabytes Tokitsukaz ...
- [Codeforces 1191D] Tokitsukaze, CSL and Stone Game(博弈论)
[Codeforces 1191D] Tokitsukaze, CSL and Stone Game(博弈论) 题面 有n堆石子,两个人轮流取石子,一次只能从某堆里取一颗.如果某个人取的时候已经没有石 ...
- Codeforces 1190C. Tokitsukaze and Duel
传送门 注意到后手可以模仿先手的操作,那么如果一回合之内没法决定胜负则一定 $\text{once again!}$ 考虑如何判断一回合内能否决定胜负 首先如果最左边和最右的 $0$ 或 $1$ 距离 ...
- Codeforces - 1191E - Tokitsukaze and Duel - 博弈论 - 尺取
https://codeforc.es/contest/1191/problem/E 参考自:http://www.mamicode.com/info-detail-2726030.html 和官方题 ...
- Codeforces - 1191F - Tokitsukaze and Strange Rectangle - 组合数学 - 扫描线
https://codeforces.com/contest/1191/problem/F 看了一下题解的思路,感觉除了最后一段以外没什么启发. 首先离散化x加快速度,免得搞多一个log.其实y不需要 ...
- Codeforces - 1191C - Tokitsukaze and Discard Items - 模拟
https://codeforces.com/contest/1191/problem/C 一开始想象了一下,既然每次删除都是往前面靠,那么好像就是页数*页容量+空位数=最多容纳到的坐标. 至于为什么 ...
- Codeforces 1190C Tokitsukaze and Duel game
题意:有一个长为n的01串,两个人轮流操作,每个人可以把某个长度为m的区间变成相同颜色,谁在操作后整个串颜色相同就赢了.问最后是谁赢?(有可能平局) 思路:容易发现,如果第一个人不能一击必胜,那么他就 ...
- Codeforces 1191A Tokitsukaze and Enhancement
题目链接:http://codeforces.com/problemset/problem/1191/A 思路:枚举 16 种情况输出最高的就行. AC代码: #include<bits/std ...
随机推荐
- visual studio code -- python
录: 前提: 已安装python 在vsc中安装pthon模块 快速入门 打开控制台(ctrl+shift+P):Python: Select Interpreter,选择python解释器 或者在软 ...
- centos7 yum 安装最新的nginx 1.16
参考:https://www.cnblogs.com/opsprobe/p/10773582.html nginx官方文档说明:http://nginx.org/en/linux_packages.h ...
- 购买 Linux VPS 服务器后简单的安全设置
我们在购买了 Linux 系统的 VPS 或服务器后,一般的商家都会给你一个 root 权限的账号,并且默认的密码不会太长,这是很不安全的.经常有客户因为弱口令而被黑客暴力破解密码导致 VPS 服务器 ...
- how to convert from hex to disasm
cat ascii.hex | ascii2binary -b h -t us > ascii.bin x86dis -e 0 -s att -f ascii.bin echo "d8 ...
- css篇-简化版
[CSS篇]简化版 (1) CSS盒模型 CSS盒模型 题目:谈谈你对CSS盒模型的认识 1) 基本概念:标准模型+IE模型 2) 标准模型和IE模型的区别 计算宽度和 ...
- 响应式web开发的一些文章
CSS Device Adaptation:关注 W3C 建议的 CSS 设备适配标准. “在 CSS 中使用 LESS 实现更多的功能”(作者:Uche Ogbuji,developerWorks, ...
- [轉]Linux kernel <2.6.29 exit_notify() local root exploit分析(2009-1337)
author : deep_pro目前网上的这个exploit(http://www.milw0rm.com/exploits/8369)的分析是有些问题的(http://forum.evilocta ...
- A 小G数数
题目链接 题解: 此题可以直接暴力求解,(甚至可以四层循环 具体思想便是a[k]充当两种身份,同时判断两种不同情况,然后计数便可以了 /** /*@author victor /*language c ...
- oracle中hint 详解
Hint概述 基于代价的优化器是很聪明的,在绝大多数情况下它会选择正确的优化器,减轻了DBA的负担.但有时它也聪明反被聪明误,选择了很差的执行计划,使某个语句的执行变得奇慢无比. 此时就需要DBA进行 ...
- MVC5+EF6 完整教程
随笔分类 - MVC ASP.NET MVC MVC5+EF6 完整教程17--升级到EFCore2.0 摘要: EF Core 2.0上周已经发布了,我们也升级到core 文章内容基于vs2017, ...