codeforce
1 second
256 megabytes
standard input
standard output
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
The first player wrote number a, the second player wrote number b. How many ways to throw a dice are there, at which the first player wins, or there is a draw, or the second player wins?
The single line contains two integers a and b (1 ≤ a, b ≤ 6) — the numbers written on the paper by the first and second player, correspondingly.
Print three integers: the number of ways to throw the dice at which the first player wins, the game ends with a draw or the second player wins, correspondingly.
2 5
3 0 3
2 4
2 1 3
The dice is a standard cube-shaped six-sided object with each side containing a number from 1 to 6, and where all numbers on all sides are distinct.
You can assume that number a is closer to number x than number b, if |a - x| < |b - x|.
做了一题水题,学校太坑,晚上想做场比赛都费劲,一直断电,一会睡觉吧。
#include<stdio.h>
int main(int argc, char const *argv[])
{
int a, b;
while(~scanf("%d%d", &a, &b))
{
if(!((a + b) % ))
{
if(a == b)
{
printf("0 6 0\n");
}
else if(a < b)
{
printf("%d ", (a + b)/ - );
printf("1 ");
printf("%d\n", - (a+b)/);
}
else
{
printf("%d ", -(a+b)/);
printf("1 ");
printf("%d\n", (a+b)/ - );
}
}
else
{
if(a < b)
{
printf("%d ", (a + b)/);
printf("0 ");
printf("%d\n", - (a + b)/);
}
else
{
printf("%d ", -(a + b)/);
printf("0 ");
printf("%d\n", (a+b)/);
}
}
}
return ;
}
codeforce的更多相关文章
- Codeforce - Street Lamps
Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is ...
- Codeforce Round #216 Div2
e,还是写一下这次的codeforce吧...庆祝这个月的开始,看自己有能,b到什么样! cf的第二题,脑抽的交了错两次后过了pretest然后system的挂了..脑子里还有自己要挂的感觉,果然回头 ...
- Codeforce 水题报告(2)
又水了一发Codeforce ,这次继续发发题解顺便给自己PKUSC攒攒人品吧 CodeForces 438C:The Child and Polygon: 描述:给出一个多边形,求三角剖分的方案数( ...
- codeforce 375_2_b_c
codeforce 375_2 标签: 水题 好久没有打代码,竟然一场比赛两次卡在边界条件上....跪 b.题意很简单...纯模拟就可以了,开始忘记了当字符串结束的时候也要更新两个值,所以就错了 #i ...
- codeforce 367dev2_c dp
codeforce 367dev2_c dp 标签: dp 题意: 你可以通过反转任意字符串,使得所给的所有字符串排列顺序为字典序,每次反转都有一定的代价,问你最小的代价 题解:水水的dp...仔细想 ...
- 三维dp&codeforce 369_2_C
三维dp&codeforce 369_2_C 标签: dp codeforce 369_2_C 题意: 一排树,初始的时候有的有颜色,有的没有颜色,现在给没有颜色的树染色,给出n课树,用m种燃 ...
- 强连通分量&hdu_1269&Codeforce 369D
强连通分量 标签: 图论 算法介绍 还记得割点割边算法吗.回顾一下,tarjan算法,dfs过程中记录当前点的时间戳,并通过它的子节点的low值更新它的low,low值是这个点不通过它的父亲节点最远可 ...
- 【树状数组】区间出现偶数次数的异或和(区间不同数的异或和)@ codeforce 703 D
[树状数组]区间出现偶数次数的异或和(区间不同数的异或和)@ codeforce 703 D PROBLEM 题目描述 初始给定n个卡片拍成一排,其中第i个卡片上的数为x[i]. 有q个询问,每次询问 ...
- 解题报告:codeforce 7C Line
codeforce 7C C. Line time limit per test1 second memory limit per test256 megabytes A line on the pl ...
- Two progressions CodeForce 125D 思维题
An arithmetic progression is such a non-empty sequence of numbers where the difference between any t ...
随机推荐
- jQuery弹性滑块导航
曾起何时在某网站上看到一弹性滑块导航的效果,瞬间被些效果吸引,开始以为是用FLASH实现的,但查源代码发现用的是JQuery缓动效果. 今天心血来潮想拿这个效果练练手.也看看这段时间学习JS及jque ...
- Python3 基础
Hello world 在文本编辑器中,键入python执行代码,保存文件为hello.py print('hello, world') 注意print前面不要有任何空格.然后,选择一个目录,例如C: ...
- [C#]『CountdownEvent』任务并行库使用小计
System.Threading.CountdownEvent 是一个同步基元,它在收到一定次数的信号之后,将会解除对其等待线程的锁定. CountdownEvent 专门用于以下情况:您必须使用 ...
- 字符串长度计算、截取、url参数获取、计算百分比、时间戳格式化
1.中英混合文字字符截取 //中文长度截取计算,可取中英混合,个数向上取整,精确度1个英文字符误差,一个英文算一个字符,一个汉字算一个字符. //sub("中文zlsd",1) - ...
- html5有什么布局标签
header h1 nav ul li a section(id) div h3 article figure img article h4 header time datetime='' body ...
- php怎么保留相除后几位小数:sprintf
$n=0.1265489; echo sprintf("%.2f", $n); // 0.13
- chgrp命令
chgrp命令用于变更文件或目录的所属群组. 在UNIX系统家族里,文件或目录权限的掌控以拥有者及所属群组来管理.您可以使用chgrp指令去变更文件与目录的所属群组,设置方式采用群组名称或群组识别码皆 ...
- 转:浅谈命令查询职责分离(CQRS)模式
原文来自于:http://www.cnblogs.com/yangecnu/p/Introduction-CQRS.html 在常用的三层架构中,通常都是通过数据访问层来修改或者查询数据,一般修改和查 ...
- word中的表格空白部分整不掉,下面的表格拉不上来
是因为下页的表格太大,占据了一页,要把下面的表格拉小一点
- Java多线程初学者指南(6):慎重使用volatile关键字
volatile关键字相信了解Java多线程的读者都很清楚它的作用,和sychnorized 一样用于多线程的同步.volatile关键字用于声明简单类型变量,如int.float.boolean等数 ...