您的位置:首页 > 其它

Codeforces 335A.Magic Spheres

2015-12-12 08:55 274 查看
(这种题居然要写解题报告我也是醉了,说好了要做点高难度的呢?!)

这题当时半夜没想明白,第二天在栗神的帮助理解下琢磨出来了。

一句话,作差大于0除以2小于零就不管最后求和看看是不是大于0就好了。。。

#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
int a, b, c, x, y, z;
while(~scanf("%d%d%d%d%d%d", &a, &b, &c, &x, &y, &z)){
int r = a - x;
int s = b - y;
int t = c - z;
if(r > 0) r = r / 2;
if(s > 0) s = s / 2;
if(t > 0) t = t / 2;
int sum = r + s + t;
if(sum >= 0) printf("Yes\n");
else printf("No\n");
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: