Codeforces Round #564 (Div. 2)A
A. Nauuo and Votes
题目链接:http://codeforces.com/contest/1173/problem/A
题目
Nauuo is a girl who loves writing comments.
One day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.
It's known that there were xpersons who would upvote, yy y persons who would downvote, and there were also another z persons who would vote, but you don't know whether they would upvote or downvote. Note that each of the x+y+z people would vote exactly one time.
There are three different results: if there are more people upvote than downvote, the result will be "+"; if there are more people downvote than upvote, the result will be "-"; otherwise the result will be "0".
Because of the z z unknown persons, the result may be uncertain (i.e. there are more than one possible results). More formally, the result is uncertain if and only if there exist two different situations of how the z z persons vote, that the results are different in the two situations.
Tell Nauuo the result or report that the result is uncertain.
Input
The only line contains three integers x,y,z(0=<x,y,z<=100) x, corresponding to the number of persons who would upvote, downvote or unknown.
Output
If there is only one possible result, print the result : "+", "-" or "0".
Otherwise, print "?" to report that the result is uncertain.
Example
intput
3 7 0
output
-
题意
There are there numbers , they are x , y and z. you can give z to x and y,
if x are the most ,you can output "+",
if y are the most ,you can output "-",
if you are not sure which are the most,you should output "?".
思路
it's a easy problem,you can compare a and b+c,b and a+c.
#include<bits/stdc++.h>
using namespace std;
int main()
{ int a,b,c;
while(cin>>a>>b>>c)
{
if(a==b&&c==)
cout<<<<endl;
else if(a>b+c)
cout<<"+"<<endl;
else if(b>a+c)
cout<<"-"<<endl;
else
cout<<"?"<<endl;
}
return ;
}
Codeforces Round #564 (Div. 2)A的更多相关文章
- Codeforces Round #564 (Div. 1)
Codeforces Round #564 (Div. 1) A Nauuo and Cards 首先如果牌库中最后的牌是\(1,2,\cdots, k\),那么就模拟一下能不能每次打出第\(k+i\ ...
- Codeforces Round #564 (Div. 2) C. Nauuo and Cards
链接:https://codeforces.com/contest/1173/problem/C 题意: Nauuo is a girl who loves playing cards. One da ...
- Codeforces Round #564 (Div. 2) B. Nauuo and Chess
链接:https://codeforces.com/contest/1173/problem/B 题意: Nauuo is a girl who loves playing chess. One da ...
- Codeforces Round #564 (Div. 2) A. Nauuo and Votes
链接:https://codeforces.com/contest/1173/problem/A 题意: Nauuo is a girl who loves writing comments. One ...
- Codeforces Round #564 (Div. 2)B
B. Nauuo and Chess 题目链接:http://codeforces.com/contest/1173/problem/B 题目 Nauuo is a girl who loves pl ...
- Codeforces Round #564 (Div. 2) D. Nauuo and Circle(树形DP)
D. Nauuo and Circle •参考资料 [1]:https://www.cnblogs.com/wyxdrqc/p/10990378.html •题意 给出你一个包含 n 个点的树,这 n ...
- Codeforces Round #564 (Div. 2)
传送门 参考资料 [1]: the Chinese Editoria A. Nauuo and Votes •题意 x个人投赞同票,y人投反对票,z人不确定: 这 z 个人由你来决定是投赞同票还是反对 ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
随机推荐
- WPF 图片灰度处理
原文:WPF 图片灰度处理 文章的内容是来自微软中文技术论坛的一个帖子,当时是想将一段将图片灰度处理的代码转换为XAML的一个样式,在这里要谢谢 Xiao Yan Qiang.Sheldon _Xia ...
- It's about trust
所有问题, 最后,它归结为:信任. 你能相信别人? 我不是Low esteem.相反,我有信心.问题是.我有一个别人缺乏信任的. Daria家长们说,伪君子:我们必须相信你. Daria马上问:然后, ...
- Python 推断素数
a = raw_input() #输入数字 a = int(a) #铸造成int b=True #的标记 for i in range(2,a): #从2开始循环本身 if a%i==0: #除了自己 ...
- window下nodejs爬取gb2312网页出现乱码的解决方案
发布于 2012-8-22 18:15 5230 次浏览 最后一次编辑是 2013-2-18 22:31 linux环境下,我们可以通过 iconv 这个C++模块来处理Node.JS不支持的字 ...
- IOS开发之把 JSON 数据转化成 Arrays 或者 Dictionaries
1 前言通过 NSJSONSerialization 这个类的 JSONObjectWithData:options:error:方法来实现,把JSON 数据解析出来放在数据或者字典里面保存. 2 代 ...
- Windows NT WinLogon Notify
在NT系列Windows操作系统中,恶意软件可以通过关联Winlogon特定的事件来使自身被启动,如Lock,Logoff,Logon,Shutdown,StartScreenSaver,StartS ...
- Android Contact 导入导出 vcf格式(不依赖第三方库)
Android sdk 支持vcf处理的(忘记最低哪个版本开始支持的了,可以查一查) 备注:此代码来自Stack Overflow(原地址找不到了,o(╥﹏╥)o) 1. 导出联系人为vcf格式 Co ...
- [转]深入Android内存泄露
深入内存泄露 Android应用的内存泄露,其实就是java虚拟机的堆内存泄漏. 当然,当应用有ndk,jni时,没有及时free,本地堆也会出现内存泄漏. 本文只是针对JVM内存泄漏应用,进行阐述分 ...
- 栈内存不是只有2M吗?为什么不溢出?
#include <stdio.h> #include <wchar.h> #include <stdlib.h> #define MAX_PATH 1024 FI ...
- HttpWebRequest 在出错时获取response内容
HttpWebRequest 请求时,服务器会返回500 501这些错误 并包含错误信息,通过如下代码可以拿到错误信息 HttpWebResponse res; try { res = (HttpW ...