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 ...
随机推荐
- C#基础|值类型和引用类型以及传参问题
为了明白什么是值类型和引用类型,先引入你两个概念.堆内存与栈内存 堆内存与栈内存 由于咱的描述能力有限,就不对其下定义了,来看看两者的作用. 共同点: 都是用来存放数据的 不同点: 堆 ...
- Windows下虚拟Linux
andlinux cygwin virtualbox VMware XenServer
- Using FireMonkey Layouts
FireMonkey has many layout controls to choose from. Come learn the differences and how to use them t ...
- 134. Gas Station
题目: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. ...
- Find the capitals
Find the capitals Description: Instructions Write a function that takes a single string (word) as ar ...
- Form Personalization应用总结
1 Form Personalization 简介 Oracle EBS 11.5.10增加了Form Personalization功能,该功能不仅是技术功能的一次增强,也是对业务功能的扩展,提高了 ...
- Android开发UI之去掉title bar
去掉屏幕上的title bar有3个方法: 1.java代码实现: @Override publicvoid onCreate(Bundle savedInstanceState) { super.o ...
- Linux学习之CentOS6下Mysql数据库的安装与配置
转自:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...
- hadoop2.2编程:自定义hadoop map/reduce输入文件切割InputFormat
hadoop会对原始输入文件进行文件切割,然后把每个split传入mapper程序中进行处理,FileInputFormat是所有以文件作为数据源的InputFormat实现的基类,FileInput ...
- vijos p1193 扫雷
描述 相信大家都玩过扫雷的游戏.那是在一个n*n的矩阵里面有一些雷,要你根据一些信息找出雷来.万圣节到了,“余”任过流行起了一种简单的扫雷游戏,这个游戏规则和扫雷一样,如果某个格子没有雷,那么它里 ...