题意:a,b,c三种球,能把俩个一样的球变成另一颜色不一样的球。给你目标x,y,z,问能否经过变化至少达打目标。

 #include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<memory.h>
#include<string.h>
#include<algorithm>
#include<cmath>
const int N = ;
const int inf=-;
using namespace std;
int ans;
void fun(int x)
{
if(x>=)
{
ans+=x/;
}
else
{
ans+=x;
}
} int main()
{
int a[];
int b[];
while(~scanf("%d%d%d",&a[],&a[],&a[]))
{
scanf("%d%d%d",&b[],&b[],&b[]);
ans=;
fun(a[]-b[]);
//cout<<ans<<endl;
fun(a[]-b[]);
//cout<<ans<<endl;
fun(a[]-b[]);
//cout<<ans<<endl;
if(ans>=)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
}
return ;
}

codeforce 606A - Magic Spheres的更多相关文章

  1. CodeForces 606A Magic Spheres

    水题 /* *********************************************** Author :Zhou Zhentao Email :774388357@qq.com C ...

  2. Codeforces Round #335 (Div. 2) A. Magic Spheres 模拟

    A. Magic Spheres   Carl is a beginner magician. He has a blue, b violet and c orange magic spheres. ...

  3. Codeforces Round #335 (Div. 2) A. Magic Spheres 水题

    A. Magic Spheres Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606/ ...

  4. CodeForces--606A --Magic Spheres(模拟水题)

    Magic Spheres Time Limit: 2000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submi ...

  5. CodeForce 424C Magic Formulas

    这个题就是求出给的公式的结果. 仅仅要知道异或运算满足交换律跟结合律即可了.之后就是化简公式. #include<map> #include<string> #include& ...

  6. Codeforce 424C Magic Formulas 找规律

    题目链接:http://codeforces.com/contest/424/problem/C 题意:求Q值 思路:找规律 显然能够得到一个矩阵 把这个矩阵画出来就能发现一个横向的规律和一个主对角线 ...

  7. 【CodeForces 606A】A -特别水的题1-Magic Spheres

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginne ...

  8. Codeforces Round #335 (Div. 2)

    水 A - Magic Spheres 这题也卡了很久很久,关键是“至少”,所以只要判断多出来的是否比需要的多就行了. #include <bits/stdc++.h> using nam ...

  9. Codeforces Round #335 (Div. 2) A

    A. Magic Spheres time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

随机推荐

  1. sql之left join、right join、inner join的区别(转)

    感谢:http://www.cnblogs.com/pcjim/articles/799302.html ----------------------------------------------- ...

  2. uva 147

    一个简单的dp   面值是5的倍数  将面值都除5   因为输出问题wa .... #include <iostream> #include <cstring> #includ ...

  3. JavaScript 踩坑心得— 为了高速(上)

    一.前言 很多情况下,产品的设计与开发人员一直想打造一套高品质的解决方案,从而快速.平稳地适应产品迭代.速度是衡量产品适应性的真正且唯一的标准,而且,这并不是笔者的一家之言. 「速度是衡量适应能力的真 ...

  4. [itint5]根据前序后序遍历统计二叉树

    http://www.itint5.com/oj/#28 这题有意思.一开始还想不清楚,看了解释,很棒. 这个题目的特殊之处是所有节点的值都是不一样的. 所以递归过程可以大大简化. 先看两种遍历的性质 ...

  5. [itint5]下一个排列

    http://www.itint5.com/oj/#6 首先,试验的时候要拿5个来试,3,4个都太少了.好久没做所以方法也忘了,是先从后往前找到第一个不合顺序的,然后在后面找到比这个大的最小的来交换, ...

  6. ids & hdmi 原理

    http://www.taiwanwebinar.com/zh_TW/STATIC/SITE/dwc_hdmi_tx.pdf http://blog.csdn.net/g_salamander/art ...

  7. 如何用Java语言向串口读写数据

    原作者:赛迪网作者 shihuchen ,我在他的基础上进行了部分修改 [赛迪网讯]串口, RS-232-C(又称EIA RS-232-C,以下简称RS232)是在1970年由美国电子工业协会(EIA ...

  8. SQLite入门与分析(三)---内核概述(1)

    写在前面:从本章开始,我们开始进入SQLite的内核.为了能更好的理解SQLite,我先从总的结构上讨论一下内核,从全局把握SQLite很重要.SQLite的内核实现不是很难,但是也不是很简单.总的来 ...

  9. Android:控件布局(线性布局)LinearLayout

    LinearLayout是线性布局控件:要么横向排布,要么竖向排布 决定性属性:必须有的! android:orientation:vertical (垂直方向) .horizontal(水平方向) ...

  10. Hoax or what

    Hoax or what 题意是询问一个动态序列的最小值和最大值. 可以用multiset来实现. #include <stdio.h> #include <set> usin ...