HDU1898:Sempr == The Best Problem Solver?
来源:互联网 发布:go语言 人工智能 编辑:程序博客网 时间:2024/06/06 07:12
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!
五一假疯狂玩了三天,也是时候该认真做题了啊
不管那么多,先来道水题再说
题目长,但是其实是水题
#include <iostream>using namespace std;int main(){ int a,b,t,test; cin>>test; while(test--) { cin >> a >> b >> t; int ta = t%a,tb = t%b; if(ta == tb) cout << "Both!"; else if(ta > tb) cout << "Xiangsanzi!"; else cout << "Sempr!"; cout << endl; } return 0;}
- hdu1898 Sempr == The Best Problem Solver?
- HDU1898:Sempr == The Best Problem Solver?
- HDU1898 Sempr == The Best Problem Solver?【水题】
- HDU 1898 Sempr == The Best Problem Solver?
- Sempr == The Best Problem Solver? 1898
- hdoj 1898 Sempr == The Best Problem Solver?
- HDOJ 1898 Sempr == The Best Problem Solver?
- HDU 1898 Sempr == The Best Problem Solver?(数学题)
- HDU 1898 Sempr == The Best Problem Solver?【英语题】
- 杭电 HDU ACM 1898 Sempr == The Best Problem Solver?
- HDOJ(HDU) 1898 Sempr == The Best Problem Solver?(水题、、、)
- HDU1898
- Best Solver
- HDU 5451 Best Solver
- H电-Problem Archive-5123-who is the best?
- Math Problem Solver Privacy Policy
- HDU 5451 Best Solver(数学)
- The ? 1 ? 2 ? ... ? n = k problem
- .NET进阶系列之六:应用程序的本地化及RESGEN.exe, AL.exe
- HDU 4115 Eliminate the Conflict (2-SAT判断)
- 教授“跨界”找到芯片设计新算法
- 得到java时间戳 用于数据库中按时间戳查询数据
- Python中实现多属性排序
- HDU1898:Sempr == The Best Problem Solver?
- 【道森试听】数据字典——Dave偶像
- C#语言基础心得
- Android 基于xmpp协议,smack包,openfire服务端的高仿QQ的即时通讯实现【2】创建连接,登录openfire服务端
- Install Lamp With 1 Command In Ubuntu 12.10
- Windows 7系统安装MySQL5.5.21图解 .
- android 自由操作系统数据库
- PHP与MYSQL事务处理
- mybatis generator eclipse插件的安装