Codeforces Round #292 (Div. 2) A. Drazil and Date

 

题目地址:http://codeforces.com/contest/515/problem/A

 1 /*  2  无算法,判断(s - (a + b)) % 2是否为零,若零,表示在s步内还能走向其他的地方并且回来  3  否则,都是No  4 */  5 #include <cstdio>  6 #include <iostream>  7 #include <cstring>  8 #include <cmath>  9 #include <algorithm> 10 #include <string> 11 #include <map> 12 #include <vector> 13 #include <set> 14 using namespace std; 15 16 const int MAXN = 1e6 + 10; 17 const int INF = 0x3f3f3f3f; 18 19 int main(void) 20 { 21 //freopen ("A.in", "r", stdin); 22 23 long long a, b, s; 24 25 while (~scanf ("%I64d%I64d%I64d", &a, &b, &s)) 26  { 27 if (a < 0) a = -a; 28 if (b < 0) b = -b; 29 if (a + b <= s) 30  { 31 int x = s - (a + b); 32 if (x % 2 == 0) puts ("Yes"); 33 else puts ("No"); 34  } 35 else puts ("No"); 36  } 37 38 return 0; 39 }

 

你可能感兴趣的:(codeforces)