hdoj 1898 Sempr == The Best Problem Solver?
Sempr == The Best Problem Solver?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1490 Accepted Submission(s):
970
more than 1400 problems on POJ, but nobody know the days and nights he had spent
on solving problems.
Xiangsanzi(Chen Zhou) was a perfect problem solver too.
Now this is a story about them happened two years ago.
On March 2006, Sempr
& Xiangsanzi were new comers of hustacm team and both of them want to be
"The Best New Comers of March", so they spent days and nights solving problems
on POJ.
Now the problem is below: Both of them are perfect problem solvers
and they had the same speed, that is to say Sempr can solve the same amount of
problems as Xiangsanzi, but Sempr enjoyed submitting all the problems at the end
of every A hours but Xiangsanzi enjoyed submitting them at the end of every B
hours. In these days, static(Xiaojun Wu) was the assistant coach of hustacm, and
he would check the number of problems they solved at time T. Give you three
integers A,B,and T, you should tell me who is "The Best New Comers of March". If
they solved the same amount of problems, output "Both!". If Sempr or Xiangsanzi
submitted at time T, static would wait them.
the number of cases in the data file, followed by N lines.
For each line,
there are 3 integers: A, B, T.
Be sure that A,B and N are no more than 10000
and T is no more than 100000000.
answer for one line. If Sempr won, output "Sempr!". If Xiangsanzi won, output
"Xiangsanzi!". And if both of them won, output "Both!".
#include<stdio.h>
int main()
{
int n,a,b,t;
int suma,sumb;
scanf("%d",&n);
while(n--)
{
scanf("%d%d%d",&a,&b,&t);
suma=a*(t/a);
sumb=b*(t/b);
if(suma==sumb)
printf("Both!\n");
else if(suma<sumb)
printf("Xiangsanzi!\n");
else if(suma>sumb)
printf("Sempr!\n");
}
return 0;
}
hdoj 1898 Sempr == The Best Problem Solver?的更多相关文章
- HDOJ(HDU) 1898 Sempr == The Best Problem Solver?(水题、、、)
Problem Description As is known to all, Sempr(Liangjing Wang) had solved more than 1400 problems on ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- DFS+剪枝 HDOJ 5323 Solve this interesting problem
题目传送门 /* 题意:告诉一个区间[L,R],问根节点的n是多少 DFS+剪枝:父亲节点有四种情况:[l, r + len],[l, r + len - 1],[l - len, r],[l - l ...
- HDOJ(HDU).1016 Prime Ring Problem (DFS)
HDOJ(HDU).1016 Prime Ring Problem (DFS) [从零开始DFS(3)] 从零开始DFS HDOJ.1342 Lotto [从零开始DFS(0)] - DFS思想与框架 ...
- mutiset HDOJ 5349 MZL's simple problem
题目传送门 /* 这题可以用stl的mutiset容器方便求解,我对这东西不熟悉,TLE了几次,最后用读入外挂水过. 题解有O(n)的做法,还以为我是侥幸过的,后来才知道iterator it写在循环 ...
- HDOJ 1914 The Stable Marriage Problem
rt 稳定婚姻匹配问题 The Stable Marriage Problem Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 6553 ...
- 【HDOJ】4729 An Easy Problem for Elfness
其实是求树上的路径间的数据第K大的题目.果断主席树 + LCA.初始流量是这条路径上的最小值.若a<=b,显然直接为s->t建立pipe可以使流量最优:否则,对[0, 10**4]二分得到 ...
- hdoj 3861 The King’s Problem【强连通缩点建图&&最小路径覆盖】
The King’s Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Other ...
- HDOJ(HDU) 2132 An easy problem
Problem Description We once did a lot of recursional problem . I think some of them is easy for you ...
随机推荐
- android:Faild to install,你的主机中的软件终止了一个连接错误解决
当在用真机调试android程序时出现Faild to install,你的主机中的软件终止了一个连接错误时可以这样解决: 在手机开启usb调试和安装未知来源软件的情况下: 1:先查进入任务管理器查看 ...
- 【BZOJ1823】 [JSOI2010]满汉全席
Description 满汉全席是中国最丰盛的宴客菜肴,有许多种不同的材料透过满族或是汉族的料理方式,呈现在數量繁多的菜色之中.由于菜色众多而繁杂,只有极少數博学多闻技艺高超的厨师能够做出满汉全席,而 ...
- C# - implicit, explicit
如果类型直接没有继承关系,也没有共享接口,想在这两个类型之间进行转换,就必须重载转换运算符. 此时需要关键字implicit和explicit. 下面定义了类型ConvClass1和ConvClass ...
- Java中的编码
package coreJava; import javax.swing.plaf.synth.SynthSpinnerUI; public class EncodeDemo { public sta ...
- 【弱省胡策】Round #7 Rectangle 解题报告
orz PoPoQQQ 的神题. 我的想法是:给每一个高度都维护一个 $01$ 序列,大概就是维护一个 $Map[i][j]$ 的矩阵,然后 $Map[i][j]$ 表示第 $i$ 根柱子的高度是否 ...
- Codeforces 258 Div2
A题,n*m根木棍,相交放置,轮流取走相交的两根,最后谁不能行动,则输掉. min(n,m)&1 为1则先取者赢. B题,给定一个长度为n,且各不相同的数组,问能否通过交换连续一段L....R ...
- javaweb学习总结(四十三)——Filter高级开发
在filter中可以得到代表用户请求和响应的request.response对象,因此在编程中可以使用Decorator(装饰器)模式对request.response对象进行包装,再把包装对象传给目 ...
- 对GBK的理解(内附全部字符编码列表):扩充的2万汉字低字节的高位不等于1,而且还剩许多编码空间没有利用
各种编码查询表:http://bm.kdd.cc/ 由于GB 2312-80只收录6763个汉字,有不少汉字,如部分在GB 2312-80推出以后才简化的汉字(如“啰”),部分人名用字(如中国前总理朱 ...
- 展讯CEO:低毛利生存 由中低端转向高端
最近一两年来,芯片市场的热闹有从细分.垂直的圈子向整个大社会场景发酵的迹象. 备受各界关注的高通发垄断案,国家大基金的成立,以及展讯.锐迪科等私有化等等,都意味着这个行业的热度在快速上升.这里面既有芯 ...
- 卸载Visual Studio Code后删除右键Open with Code…
Win+R,输入 regedit ,点击确认,进入注册表编辑器 Ctrl+F,搜索 Ticino ,将搜索出来的Ticino都删除就行了