A. Playing with Dice
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

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?

Input

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.

Output

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.

Sample test(s)
input
2 5
output
3 0 3
input
2 4
output
2 1 3
Note

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的更多相关文章

  1. Codeforce - Street Lamps

    Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is ...

  2. Codeforce Round #216 Div2

    e,还是写一下这次的codeforce吧...庆祝这个月的开始,看自己有能,b到什么样! cf的第二题,脑抽的交了错两次后过了pretest然后system的挂了..脑子里还有自己要挂的感觉,果然回头 ...

  3. Codeforce 水题报告(2)

    又水了一发Codeforce ,这次继续发发题解顺便给自己PKUSC攒攒人品吧 CodeForces 438C:The Child and Polygon: 描述:给出一个多边形,求三角剖分的方案数( ...

  4. codeforce 375_2_b_c

    codeforce 375_2 标签: 水题 好久没有打代码,竟然一场比赛两次卡在边界条件上....跪 b.题意很简单...纯模拟就可以了,开始忘记了当字符串结束的时候也要更新两个值,所以就错了 #i ...

  5. codeforce 367dev2_c dp

    codeforce 367dev2_c dp 标签: dp 题意: 你可以通过反转任意字符串,使得所给的所有字符串排列顺序为字典序,每次反转都有一定的代价,问你最小的代价 题解:水水的dp...仔细想 ...

  6. 三维dp&codeforce 369_2_C

    三维dp&codeforce 369_2_C 标签: dp codeforce 369_2_C 题意: 一排树,初始的时候有的有颜色,有的没有颜色,现在给没有颜色的树染色,给出n课树,用m种燃 ...

  7. 强连通分量&hdu_1269&Codeforce 369D

    强连通分量 标签: 图论 算法介绍 还记得割点割边算法吗.回顾一下,tarjan算法,dfs过程中记录当前点的时间戳,并通过它的子节点的low值更新它的low,low值是这个点不通过它的父亲节点最远可 ...

  8. 【树状数组】区间出现偶数次数的异或和(区间不同数的异或和)@ codeforce 703 D

    [树状数组]区间出现偶数次数的异或和(区间不同数的异或和)@ codeforce 703 D PROBLEM 题目描述 初始给定n个卡片拍成一排,其中第i个卡片上的数为x[i]. 有q个询问,每次询问 ...

  9. 解题报告:codeforce 7C Line

    codeforce 7C C. Line time limit per test1 second memory limit per test256 megabytes A line on the pl ...

  10. Two progressions CodeForce 125D 思维题

    An arithmetic progression is such a non-empty sequence of numbers where the difference between any t ...

随机推荐

  1. JavaScript学习笔记--ES6学习(四) 字符串的扩展

    ES6对字符串进行了一些扩展,主要表现在对Unicode 大于\uFFFF的字符的处理上. 1. ES6中字符的Unicode表示方法 在ES5中,字符串的Unicode表示方法: \uxxxx . ...

  2. 10.10_魔兽账号,OSC代码托管演示,研究SQL别忘记了,git

    (1)juedui8456juedui456chixin0769魔兽世界账号112288 (2)EasyXls.开源中国推出 PaaS@OSC 代码演示和运行平台.git.oschina.coding ...

  3. 09.25日记(2014年9月25日23:22:06)用java这么多年面向对象我真的懂了吗,测试先行理念会玩吗

    二胡 (1)应该找些书来看看,工作N年并不代表就有N年的工作经验. (2)DiaTransit02,DiaDept02,DiaAirport02,DiaHighway02.都具有x,y属性为何不设计一 ...

  4. 计数排序之python 实现源码

    old = [2, 5, 3, 0, 2, 3, 0, 3] new = [0, 0, 0, 0, 0, 0] for i in range(len(old)): new[old[i]] = new[ ...

  5. 浅谈.prop() 和 attr() 的区别

    今天编码时遇到一个问题,通过后台查询的数据设置前端checkbox的选中状态,设置选中状态为.attr('checked','true');没有问题,但是当数据重新加载时,checkbox应清空即所有 ...

  6. 网站开发常用jQuery插件总结(13)定位插件scrollto

    一.scrollto插件功能 scrollto用于定位页面中元素的位置,并使滚动条滚动到当前元素. 二.scrollto官方地址 https://github.com/flesler/jquery.s ...

  7. phpcms V9 首页模板文件解析(转)

    转自:http://www.cnblogs.com/Braveliu/p/5100018.html 转在了解了<phpcms V9 URL访问解析>之后,我们已经知道首页最终执行的是con ...

  8. 学习PHP爬虫--《Webbots、Spiders和Screen Scrapers:技术解析与应用实践(原书第2版)》

    <Webbots.Spiders和Screen Scrapers:技术解析与应用实践(原书第2版)> 译者序 前言 第一部分 基础概念和技术 第1章 本书主要内容3 1.1 发现互联网的真 ...

  9. STM32之外部中断控制

    一.STM32外部中断 1.STM32外部中断结构图 如上图所示:主要包括四个环节,GPIO.AFIO.EXTI.NVIC.以STM32F103VE(100脚)为例说明硬件模块的数量: GPIO:   ...

  10. gcc -D选项

    一.概念 gcc的-D选项可以定义宏,这是什么意思呢? C语言源程序中有#define定义的宏,可以起到替换.条件编译的功能:定义宏的方式是放在头文件或者C文件中.gcc提供了另外一种宏定义的方法,当 ...