hdu 1898
来源:互联网 发布:广西网络推广168108cc 编辑:程序博客网 时间:2024/05/14 11:03
Sempr == The Best Problem Solver?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 741 Accepted Submission(s): 475
Problem Description
As is known to all, Sempr(Liangjing Wang) had solved 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.
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.
Input
In the first line there is an integer N, which means 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.
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.
Output
For each case of the input, you should output the answer for one line. If Sempr won, output "Sempr!". If Xiangsanzi won, output "Xiangsanzi!". And if both of them won, output "Both!".
Sample Input
32 3 42 3 62 3 9
Sample Output
Sempr!Both!Xiangsanzi!
Author
Sempr|CrazyBird|hust07p43
Source
HDU 2008-4 Programming Contest
Recommend
lcy
//该题就是求在T时间内,各自提交的数目#include <stdio.h>#include <string.h>int main (){ int a, b, t, n;scanf ("%d", &n); while (n--) {scanf ("%d%d%d", &a, &b, &t);a = t/a*a;b = t/b*b;if(a > b)printf("Sempr!\n");else if(a == b)printf("Both!\n");elseprintf("Xiangsanzi!\n"); } return 0;}
- hdu 1898
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- 技术人员少做老板梦
- [iPhone中级]iPhone实现自定义多选列表
- Lax Wendroff格式
- Linux上安装JDK1.7与Tomcat7.0
- 如何安装rpm软件包
- hdu 1898
- ubuntu更换163的源
- Hibernate持久化对象的三种状态
- Weblogic上修改类报异常:java.lang.ClassCastException
- jsp的内部方法jspInit(),_jspService(),jspDestroy()
- mvc3 国际化
- 诡异:bind()函数出现WSAEFAULT(10014) 错误
- 我们一起写opengl程序
- C 程序运行时的数据结构