CodeForces 606A Magic Spheres
水题
/* *********************************************** Author :Zhou Zhentao Email :774388357@qq.com Created Time :2015/12/15 12:45:27 File Name :main.cpp ************************************************ */ #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; int a,b,c; int x,y,z; int flagA,flagB,flagC; int flag2; int main() { while(~scanf("%d%d%d",&a,&b,&c)) { scanf("%d%d%d",&x,&y,&z); flagA=0,flagB=0,flagC=0,flag2=0; int num=0; if(a>=x) flagA=flagA+a-x; else flag2=flag2+x-a; if(b>=y) flagB=flagB+b-y; else flag2=flag2+y-b; if(c>=z) flagC=flagC+c-z; else flag2=flag2+z-c; num=num+flagA/2; num=num+flagB/2; num=num+flagC/2; if(num>=flag2) printf("Yes\n"); else printf("No\n"); } return 0; }