ZOJ 3610Yet Another Story of Rock-paper-scissors
来源:互联网 发布:淘宝开店做代理 编辑:程序博客网 时间:2024/06/06 09:11
Akihisa and Hideyoshi were lovers. They were sentenced to death by the FFF Inquisition. Ryou, the leader of the FFF Inquisition, promised that the winner of Rock-paper-scissors would be immune from the punishment. Being lovers, Akihisa and Hideyoshi decided to die together with their fists clenched, which indicated rocks in the game. However, at the last moment, Akihisa chose paper and Hideyoshi chose scissors. As a result, Akihisa was punished by the FFF Inquisition and Hideyoshi survived alone.
When a boy named b and a girl named g are being punished by the FFF Inquisition, they will play Rock-paper-scissors and the winner will survive. If there is a tie, then neither of they will survive. At first, they promise to choose the same gesture x. But actually, the boy wants to win and the girl wants to lose. Of course, neither of them knows that the other one may change his/her gesture. At last, who will survive?
There are multiple test cases. The first line of input is an integer T ≈ 1000 indicating the number of test cases.
Each test case contains three strings -- b g x. All strings consist of letters and their lengths never exceed 20. The gesture x is always one of "rock"
, "paper"
and "scissors"
.
If there is a tie, output "Nobody will survive"
. Otherwise, output "y will survive"
where y is the name of the winner.
1Akihisa Hideyoshi rock
Hideyoshi will survive
简单题
#include<map>#include<cmath> #include<queue> #include<vector>#include<cstdio> #include<cstring> #include<algorithm> using namespace std;#define ms(x,y) memset(x,y,sizeof(x)) #define rep(i,j,k) for(int i=j;i<=k;i++) #define per(i,j,k) for(int i=j;i>=k;i--) #define loop(i,j,k) for (int i=j;i!=-1;i=k[i]) #define inone(x) scanf("%d",&x) #define intwo(x,y) scanf("%d%d",&x,&y) #define inthr(x,y,z) scanf("%d%d%d",&x,&y,&z) typedef long long LL;const int low(int x) { return x&-x; }const int INF = 0x7FFFFFFF;const int mod = 1e9 + 7;const int N = 1e3 + 10;int T;char x[N], y[N], z[N];int main(){for (inone(T); T--;){scanf("%s%s%s", x, y, z);printf("%s will survive\n", y);}return 0;}
- zoj 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610Yet Another Story of Rock-paper-scissors
- zoj 3610 Yet Another Story of Rock-paper-scissors 忽悠。。
- Yet Another Story of Rock-paper-scissors
- K - Yet Another Story of Rock-paper-scissors
- Yet Another Story of Rock-paper-scissors(水题)
- ZOJ3610-Yet Another Story of Rock-paper-scissors
- K. Yet Another Story of Rock-paper-scissors
- prepare for the provincial time --9.1-- Yet Another Story of Rock-paper-scissors
- 省赛热身赛之——Yet Another Story of Rock-paper-scissors
- 2014ACM集训13级PK赛3-Yet Another Story of Rock-paper-scissors
- 4952. Another Rock-Paper-Scissors Problem
- Sicily 4952. Another Rock-Paper-Scissors Problem
- CF100015A - Another Rock-Paper-Scissors Problem
- mysql常用语句、命令(增删改查功能)
- 天梯赛--集合相似度
- 山东大学软件学院数据结构课程设计第三题
- Java中Arrays的asList()方法 中int[]使用问题
- Perl 笔记——调试常用命令
- ZOJ 3610Yet Another Story of Rock-paper-scissors
- 使用SBT编译Spark子项目
- 框架之Hibernate(二)
- SpringMVC与Struts2的对比
- 重点推荐:设计模式学习资料
- c#中字典序升序排列
- nyoj325 zb的生日(dfs)
- springMVC框架(一)HelloWold
- 团体程序设计天梯赛-练习集-L2-012. 关于堆的判断(小顶堆)