Description

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 -- bgx. 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

1
Akihisa Hideyoshi rock

Sample Output

Hideyoshi will survive

题目大意:T种情况,A,B两人商量好同时出剪刀石头或布,结果A想赢,B想输,输出最终谁赢。
解题思路:B赢
 #include<iostream>
#include<string.h>
#include<cstring>
#include<string>
using namespace std;
int main(){
int T;cin>>T;
while(T--){
string str1,str2,str3;
cin>>str1>>str2>>str3;
cout<<str2<<" will survive\n";
}return ;
}

[ACM_水题] Yet Another Story of Rock-paper-scissors [超水 剪刀石头布]的更多相关文章

  1. 2018 ACM-ICPC 中国大学生程序设计竞赛线上赛 H题 Rock Paper Scissors Lizard Spock.(FFT字符串匹配)

    2018 ACM-ICPC 中国大学生程序设计竞赛线上赛:https://www.jisuanke.com/contest/1227 题目链接:https://nanti.jisuanke.com/t ...

  2. 题解 CF1426E - Rock, Paper, Scissors

    一眼题. 第一问很简单吧,就是每个 \(\tt Alice\) 能赢的都尽量让他赢. 第二问很简单吧,就是让 \(\tt Alice\) 输的或平局的尽量多,于是跑个网络最大流.\(1 - 3\) 的 ...

  3. SDUT 3568 Rock Paper Scissors 状压统计

    就是改成把一个字符串改成三进制状压,然后分成前5位,后5位统计, 然后直接统计 f[i][j][k]代表,后5局状压为k的,前5局比和j状态比输了5局的有多少个人 复杂度是O(T*30000*25*m ...

  4. FFT(Rock Paper Scissors Gym - 101667H)

    题目链接:https://vjudge.net/problem/Gym-101667H 题目大意:首先给你两个字符串,R代表石头,P代表布,S代表剪刀,第一个字符串代表第一个人每一次出的类型,第二个字 ...

  5. Gym - 101667H - Rock Paper Scissors FFT 求区间相同个数

    Gym - 101667H:https://vjudge.net/problem/Gym-101667H 参考:https://blog.csdn.net/weixin_37517391/articl ...

  6. Gym101667 H. Rock Paper Scissors

    将第二个字符串改成能赢对方时对方的字符并倒序后,字符串匹配就是卷积的过程. 那么就枚举字符做三次卷积即可. #include <bits/stdc++.h> struct Complex ...

  7. 【题解】CF1426E Rock, Paper, Scissors

    题目戳我 \(\text{Solution:}\) 考虑第二问,赢的局数最小,即输和平的局数最多. 考虑网络流,\(1,2,3\)表示\(Alice\)选择的三种可能性,\(4,5,6\)同理. 它们 ...

  8. Atcoder 水题选做

    为什么是水题选做呢?因为我只会水题啊 ( 为什么是$Atcoder$呢?因为暑假学长来讲课的时候讲了三件事:不要用洛谷,不要用dev-c++,不要用单步调试.$bzoj$太难了,$Topcoder$整 ...

  9. Codeforces数据结构(水题)小结

    最近在使用codeblock,所以就先刷一些水题上上手 使用codeblock遇到的问题 1.无法进行编译-------从setting中的编译器设置中配置编译器 2.建立cpp后无法调试------ ...

  10. HDOJ(HDU) 2164 Rock, Paper, or Scissors?

    Problem Description Rock, Paper, Scissors is a two player game, where each player simultaneously cho ...

随机推荐

  1. NGUI ScrollView总结

    1顶级父类加boxCollider和UIDragScrollView脚本保证在item拖走后也能通过拖拽剩余区域的方式操作. 2下一级添加UIPanel在Clipping设定区域,注意如果设定soft ...

  2. sql语句 关于日期时间、类型转换的东西

    (一) 1, select update_date, CONVERT(VARCHAR(30),update_date,111) jj ,CONVERT(VARCHAR(30),update_date, ...

  3. zzulioj 1907小火山的宝藏交易(dfs记忆化搜索)

    #include <stdio.h> #include <algorithm> #include <string.h> #include <vector> ...

  4. 钩子机制(hook)

    钩子是编程惯用的一种手法,用来解决一种或多种特殊情况的处理. 简单来说,钩子就是适配器原理,或者说是表驱动原理,我们预先定义了一些钩子,在正常的代码逻辑中使用钩子去适配一些特殊的属性,样式或事件,这样 ...

  5. 第五章 springboot + mybatis

    springboot集成了springJDBC与JPA,但是没有集成mybatis,所以想要使用mybatis就要自己去集成.集成方式相当简单. 1.项目结构 2.pom.xml <!-- 与数 ...

  6. iOS开发:深入理解GCD 第二篇(dispatch_group、dispatch_barrier、基于线程安全的多读单写)

    Dispatch Group在追加到Dispatch Queue中的多个任务处理完毕之后想执行结束处理,这种需求会经常出现.如果只是使用一个Serial Dispatch Queue(串行队列)时,只 ...

  7. Ubuntu10.0.4安装NDK

    android版本遇到.so文件crash,需要使用ndk来定位报错代码. 从这里下载ndk安装文件: http://www.androiddevtools.cn/ 运行 ./android-ndk- ...

  8. 【Linux】LAMP环境的搭建

    LAMP定义 LAMP指的Linux(操作系统).ApacheHTTP 服务器,MySQL(有时也指MariaDB,数据库软件) 和PHP(有时也是指Perl或Python) 的第一个字母,一般用来建 ...

  9. hdu 4107

    Gangster Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  10. lua 入门学习

    -- 1.Hello world print( "--------------1--------------") print("Hello world"); - ...