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 ...
随机推荐
- 哥德巴赫猜想证明(C语言实现50以内的正偶数证明)
<一>哥德巴赫猜想内容: 一个充分大的偶数(大于或等于6)可以分解为两个素数之和. <二>实现要点: 要点: 判断素数(质数):除了1和本身没有其他约数. 最小的质数:2 判断 ...
- bzoj1068:[SCOI2007]压缩
思路:区间dp,设状态f[l][r][bo]表示区间[l,r]的答案,bo=1表示该区间可以放M也可以不放M,bo=0表示该区间不能放M,并且对于任意一个状态f,l和l-1之间均有一个M,于是就可以进 ...
- 九度OJ 1435 迷瘴
题目地址:http://ac.jobdu.com/problem.php?pid=1435 题目描述: 通过悬崖的yifenfei,又面临着幽谷的考验—— 幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满 ...
- OpenJudge/Poj 1657 Distance on Chessboard
1.链接地址: http://bailian.openjudge.cn/practice/1657 http://poj.org/problem?id=1657 2.题目: 总时间限制: 1000ms ...
- Cron运行原理
from:http://blog.chinaunix.net/uid-20682147-id-4977039.html 目录 目录 1 1. 前言 1 2. 示例 1 3. 工作过程 2 4. 一个诡 ...
- InkPicture 控件使用_01
private System.ComponentModel.Container components = null; private Microsoft.Ink.InkOverlay m_InkOv ...
- css3动画使用技巧之—border旋转时的应用。
<html> <head> <title>css3动画border旋转时的应用.</title> <meta charset="UTF- ...
- python实现模拟登录【转】
原文网址:http://www.blogjava.net/hongqiang/archive/2012/08/01/384552.html 本文主要用python实现了对网站的模拟登录.通过自己构造p ...
- 【C#】动态加载dll程序集
原文:http://www.cnblogs.com/bomo/archive/2013/03/01/2938165.html 很多时候我们需要用到引用其他程序集,有些程序集是.Net生成的,可以支持反 ...
- CKplayer 新手入门超简单使用教程
网页播放器都有使用的前提(问1). ~~~~~~~分隔线~~~~~~~ 只需一步先看播放器效果(问2): 下载附件,解压内容(ckplayer文件夹和ckplayer.html)到网站根目录,在浏览器 ...