Drazil and Date
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point (0, 0) and Varda's home is located in point (a, b). In each step, he can move in a unit distance in horizontal or vertical direction. In other words, from position (x, y) he can go to positions (x + 1, y), (x - 1, y), (x, y + 1) or (x, y - 1).

Unfortunately, Drazil doesn't have sense of direction. So he randomly chooses the direction he will go to in each step. He may accidentally return back to his house during his travel. Drazil may even not notice that he has arrived to (a, b) and continue travelling.

Luckily, Drazil arrived to the position (a, b) successfully. Drazil said to Varda: "It took me exactly s steps to travel from my house to yours". But Varda is confused about his words, she is not sure that it is possible to get from (0, 0) to (a, b) in exactly s steps. Can you find out if it is possible for Varda?

Input

You are given three integers ab, and s ( - 109 ≤ a, b ≤ 109, 1 ≤ s ≤ 2·109) in a single line.

Output

If you think Drazil made a mistake and it is impossible to take exactly s steps and get from his home to Varda's home, print "No" (without quotes).

Otherwise, print "Yes".

Sample test(s)
input
5 5 11
output
No
input
10 15 25
output
Yes
input
0 5 1
output
No
input
0 0 2
output
Yes

居然WA了两发。。。。第一次忘了判断是偶数时能否到达,第二次忘了终点坐标可以是负的,我。。。。
 #include <iostream>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cctype>
#include <queue>
#include <map>
using namespace std; int main(void)
{
int a,b,t; cin >> a >> b >> t;
if((t - (abs(a) + abs(b))) % )
cout << "No" << endl;
else if(t >= (abs(a) + abs(b)))
cout << "Yes" << endl;
else
cout << "No" << endl; return ;
}

CF Drazil and Date (奇偶剪枝)的更多相关文章

  1. HDU 1010 Tempter of the Bone(DFS+奇偶剪枝)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010 题目大意: 输入 n m t,生成 n*m 矩阵,矩阵元素由 ‘.’ 'S' 'D' 'X' 四 ...

  2. hdu.1010.Tempter of the Bone(dfs+奇偶剪枝)

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  3. hdu 1010:Tempter of the Bone(DFS + 奇偶剪枝)

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  4. HDU 1010 (DFS搜索+奇偶剪枝)

    题目链接:  http://acm.hdu.edu.cn/showproblem.php?pid=1010 题目大意:给定起点和终点,问刚好在t步时能否到达终点. 解题思路: 4个剪枝. ①dep&g ...

  5. HDOJ-ACM1010(JAVA) 奇偶剪枝法 迷宫搜索

    转载声明:原文转自:http://www.cnblogs.com/xiezie/p/5568822.html 第一次遇到迷宫搜索,给我的感觉是十分惊喜的:搞懂这个的话,感觉自己又掌握了一项技能~ 个人 ...

  6. hdoj 1010 Tempter of the Bone【dfs查找能否在规定步数时从起点到达终点】【奇偶剪枝】

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  7. 杭电1010(dfs + 奇偶剪枝)

    题目: The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked ...

  8. HDU 1010Tempter of the Bone(奇偶剪枝回溯dfs)

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  9. Tempter of the Bone(dfs奇偶剪枝)

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

随机推荐

  1. C++问题-UniqueAppObject.cpp(147): error C3861: “GUXClientInit”: 找不到标识符

    问题经过:在同事的产品上增加新功能,拿来的代码包,用VS打开后,提示某个文件不存在,从项目中移除.CPP.H文件后,提示错误,提示如下:1>UniqueAppObject.cpp(147): e ...

  2. POJ 1287 Networking (最小生成树)

    Networking 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/B Description You are assigned ...

  3. ajax 源生,jquery封装 例子 相同哈哈

    http://hi.baidu.com/7636553/item/bbcf5fc93c8c950aac092f22 ajax使用回调函数的例子(原生代码和jquery代码) 一. ajax代码存在的问 ...

  4. C#全角半角转换函数

    Code#region 全角半角转换 /// <summary> /// 转全角的函数(SBC case) /// </summary> /// <param name= ...

  5. Windows 环境下于虚拟环境安装源码安装 cx_oracle

    安装前提条件: (1).安装 instantclient-basic-nt (2).安装 instantclient-sdk-nt (3).安装 Microsoft Visual C++ Compil ...

  6. [1.1]Environment preset on a Windows server

    1. Python 3.5.1 (also on your personal computer) 2. Django 1.10.1 (also on your personal computer) 3 ...

  7. SAP标准教材列表

    AC010 mySAP Financials Overview to Financial Accounting and ReportingAC020 mySAP Financials Investme ...

  8. Java网页数据采集器[中篇-数据存储]【转载】

    本期概述 上期我们学习了html页面的数据采集,为了方便我们今后来调用收集到的数据,首先我们需要学习下如何将这些采集到的数据存储起来(MySql数据库). 数据采集页面 2011-2012赛季英超球队 ...

  9. php7.0 redis扩展下载地址

    http://windows.php.net/downloads/pecl/snaps/redis/20160319/

  10. Codeforces Gym 100286G Giant Screen 水题

    Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...