codeforce 606A - Magic Spheres
题意: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的更多相关文章
- CodeForces 606A Magic Spheres
水题 /* *********************************************** Author :Zhou Zhentao Email :774388357@qq.com C ...
- 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. ...
- 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/ ...
- CodeForces--606A --Magic Spheres(模拟水题)
Magic Spheres Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submi ...
- CodeForce 424C Magic Formulas
这个题就是求出给的公式的结果. 仅仅要知道异或运算满足交换律跟结合律即可了.之后就是化简公式. #include<map> #include<string> #include& ...
- Codeforce 424C Magic Formulas 找规律
题目链接:http://codeforces.com/contest/424/problem/C 题意:求Q值 思路:找规律 显然能够得到一个矩阵 把这个矩阵画出来就能发现一个横向的规律和一个主对角线 ...
- 【CodeForces 606A】A -特别水的题1-Magic Spheres
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginne ...
- Codeforces Round #335 (Div. 2)
水 A - Magic Spheres 这题也卡了很久很久,关键是“至少”,所以只要判断多出来的是否比需要的多就行了. #include <bits/stdc++.h> using nam ...
- Codeforces Round #335 (Div. 2) A
A. Magic Spheres time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
随机推荐
- ExtJS4.2学习(八)表格限制输入数据的类型(转)
鸣谢:http://www.shuyangyang.com.cn/jishuliangongfang/qianduanjishu/2013-11-14/177.html --------------- ...
- mac下设置maven环境
在mac系统下设置maven环境. 1.首先通过终端打开 .bash_profile 2.设置maven解压后的路径地址 环境变量设置如下: MAVEN_HOME .PATH 两个变量即可 3. ...
- myeclipse报错:Could not create the view: An unexpected exception was thrown.
打开server窗口,发现显示:Could not create the view: An unexpected exception was thrown. 此处解决方法: 关闭myeclipse 删 ...
- Hibernate4.1.4配置二级缓存EHCache步骤
1.当然首先引入EHCache相关的jar包 这些包不需要另外下载,在Hibernate官方网站下载Hibernate4.1.7的压缩包(如:hibernate-release-4.1.7.Final ...
- Akka Stream文档翻译:Quick Start Guide: Reactive Tweets
Quick Start Guide: Reactive Tweets 快速入门指南: Reactive Tweets (reactive tweets 大概可以理解为“响应式推文”,在此可以测试下GF ...
- 双十一运维怎么过,OneAPM 帮你救火,轻松运维
一年一度的双十一来了 有人剁手买买买,有人愁眉苦脸抱着服务器哭 对,说的就是你,汪 苦逼的运维工程师双十一怎么过来的? 守着电脑看预警还是通宵加服务器扩容 还是帮女朋友守着购物车等着一键清空 或者 今 ...
- 学习笔记:shared_ptr陷阱
条款1:不要把一个原生指针给多个shared_ptr管理 int* ptr = new int; shared_ptr<int> p1(ptr); shared_ptr<int> ...
- 1990-D. 幻方
描述 河图,黑点白点排列奥秘数阵:洛书,纵横斜三条线上数和皆15.这是一个古老的数字游戏,将1~9填入一个九宫格,使得每行.每列.对角线上数字的和都相同(为15).在西方,满足类似规律的矩阵称之为幻方 ...
- Servlet 下载文件
这几天有点懒散,还好没有忘记看书,上周去了国家图书馆翻阅了一些和Java相关的书籍,其实这些书都是自己以前看过或者听过,按理来说,不应该看自己已经看过的书籍,应该找一些最新的书籍去看,但是每次走到书架 ...
- 安装Hadoop系列 — 安装JDK-8u5
安装步骤如下: 1)下载 JDK 8 从http://www.oracle.com/technetwork/java/javasebusiness/downloads/ 选择下载JDK的最新版本 JD ...