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 ...
随机推荐
- select count(*)和select count(1)的区别 (转)
A 一般情况下,Select Count (*)和Select Count(1)两着返回结果是一样的 假如表沒有主键(Primary key), 那么count(1)比count(*)快, 如果有主键 ...
- java 用JNA方法调用C++动态链接库
JNA(Java Native Access)框架是一个开源的Java框架,是SUN公司主导开发的,建立在经典的JNI的基础之上的一个框架.非常强大.易用,功能上类似与.NET的P/Invoke.你只 ...
- POJ2635——The Embarrassed Cryptographer(高精度取模+筛选取素数)
The Embarrassed Cryptographer DescriptionThe young and very promising cryptographer Odd Even has imp ...
- j2se jndi
http://blog.csdn.net/lldwolf/article/details/2299622 正如你可以看到,从JNDI中检索对象是相当方便,简单.通过使用JNDI来存储配置信息,无状态对 ...
- JMS基础(2)
1. JMS基本概念 JMS(Java Message Service) ,即Java消息服务.JMS是SUN提出的旨在统一各种消息中间件(MOM)系统接口的规范.它提供标准的产生.发送.接收消息的 ...
- ubuntu装机
备份: .bashrc profile .vimrc exports defults/ 各种workspace中的源码 goagent/ 重转后安装: apt-get install openjdk- ...
- Android 常用UI控件之TabHost(5)Tab栏在底部且在最上层也不盖tab页
tab栏在底部 <TabHost android:id="@android:id/tabhost" android:layout_width="match_pare ...
- Java面试题-Java中的锁
1. 如何实现乐观锁(CAS)?如何避免ABA问题? 答:1)读取内存值的方式实现了乐观锁(比如:SVN系统),方法:第一,比较内存值和期望值:第二,替换内存值为要替换值. 2)带参数版 ...
- chinacloud大数据新闻
2015年大数据发展八大趋势 (0 篇回复) “数据很丰满,信息很骨感”:Sight Machine想用大数据的方法,打碎两者间的屏障 (0 篇回复) 百度携大数据"圈地" ...
- java中的log中的用法和小结
Log.logInfo(s.toString());的控制台显示 jog.info的具体用法. import java.io.*; import org.apache.log4j.Logger; im ...