杭电 HDU ACM 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): 1438    Accepted Submission(s): 940

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.

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.

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

3
2 3 4
2 3 6
2 3 9

Sample Output

Sempr!
Both!
Xiangsanzi!

Author

Sempr|CrazyBird|hust07p43

就因为 把Sempr 错打成Semper 还仔细检查 都没看出来!类似的好几次了、

#include<iostream>
using namespace std;
int main()
{
	int n,a,b,t,num1,num2;
	cin>>n;
	while(n--)
	{
		cin>>a>>b>>t;
		if(t%a<t%b)
			cout<<"Sempr!"<<endl;
		else if(t%a>t%b)
			cout<<"Xiangsanzi!"<<endl;
		else
			cout<<"Both!"<<endl;
	}
	return 0;
}
		
时间: 2024-10-08 23:35:39

杭电 HDU ACM 1898 Sempr == The Best Problem Solver?的相关文章

杭电 HDU ACM 1397 Goldbach&#39;s Conjecture

Goldbach's Conjecture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4976    Accepted Submission(s): 1901 Problem Description Goldbach's Conjecture: For any even number n greater than or equal

杭电 HDU ACM 5186 zhx&#39;s submissions

zhx's submissions Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1892    Accepted Submission(s): 507 Problem Description As one of the most powerful brushes, zhx submits a lot of code on many

杭电 HDU ACM 1025 Constructing Roads In JGShining&#39;s Kingdom

Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17732    Accepted Submission(s): 5023 Problem Description JGShining's kingdom consists of 2n(n is no mo

杭电HDU ACM Uncle Tom&#39;s Inherited Land*(二分图匹配 建模)

Uncle Tom's Inherited Land* Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2496    Accepted Submission(s): 1028 Special Judge Problem Description Your old uncle Tom inherited a piece of land f

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 Problem Description As is known to all, Sempr(Liangjing Wang) had solved mor

杭电 HDU ACM 圆桌会议

圆桌会议 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3356    Accepted Submission(s): 2351 Problem Description HDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有

杭电 HDU ACM 1046 Tempter of the Bone

Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 83458    Accepted Submission(s): 22740 Problem Description The doggie found a bone in an ancient maze, which fascinated him a

杭电 HDU ACM 1496 Equations

Equations Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6065    Accepted Submission(s): 2455 Problem Description Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a,

杭电 HDU ACM 1283 最简单的计算机

最简单的计算机 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5238    Accepted Submission(s): 2967 Problem Description 一个名叫是PigHeadThree的研究组织设计了一台实验用的计算机,命名为PpMm.PpMm只能执行简单的六种命令A,B,C,D,E,F:只有二个内存M1,M