ZOJ3610-Yet Another Story of Rock-paper-scissors
来源:互联网 发布:淘宝买家如何推广赚钱 编辑:程序博客网 时间:2024/05/17 07:05
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?
Input
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"
.
Output
If there is a tie, output "Nobody will survive"
. Otherwise, output "y will survive"
where y is the name of the winner.
Sample Input
1Akihisa Hideyoshi rock
Sample Output
Hideyoshi will survive
Author: WU, Zejun
Contest: The 9th Zhejiang Provincial Collegiate Programming Contest
解题:一男一女玩石头剪刀布的游戏,一开始商量好出什么,男生想赢,女生相输,问最后谁赢
解题思路:因为石头剪刀布的相生相克关系,女生和男生心理都是固定的,所以总是女生赢。
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <vector>#include <set>#include <stack>#include <map>#include <climits>using namespace std;int main( ){ int t; string b,g,s; scanf("%d",&t); while(t--) { cin>>b>>g>>s; cout<<g<<" will survive"<<endl; } return 0;}
- ZOJ3610-Yet Another Story of Rock-paper-scissors
- 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
- K - 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
- Yet Another Story of Rock-paper-scissors(水题)
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610Yet Another Story of Rock-paper-scissors
- K. Yet Another Story of Rock-paper-scissors
- zoj 3610 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
- 【自考总结】计算机网络(一)——宏观把控
- OPC协议的编写
- pickling unpickling
- Mac安装V8和Less
- SqlServer 多服务器管理(MSSQL分布式作业管理)
- ZOJ3610-Yet Another Story of Rock-paper-scissors
- Glide简单使用
- Codeforces Round #402 (Div. 2) C. Dishonest Sellers
- 同时兼容 Xcode 7 和 Xcode 8
- list与iterator查询的区别
- Zookeeper的灵魂--Paxos
- 约瑟夫环问题数学优化方法
- JavaSE基础
- CPU,内存, 硬盘,指令之间的关系