首页
比赛
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
斗兽棋
24条解析
开通博客写题解
Silencer76
发表于 2025-06-10 13:39:31
题目链接 斗兽棋 题目描述 牛牛和牛妹在玩一个博弈游戏。每人从 elephant, tiger, cat, mouse 四种棋子中选择一个。 胜负规则形成一个循环克制链: elephant 吃 tiger tiger 吃 cat cat 吃 mouse mouse 吃 elephant 如果一方
展开全文
GB279824
发表于 2025-06-08 13:30:59
rules = { "elephant":"tiger", "tiger":"cat", "cat":"mouse", "mouse&qu
展开全文
爱读书的菠萝蜜很想去杭州
发表于 2025-06-08 17:48:31
import re import sys bro,sis = input().split() ani_sor = ['elephant','tiger','cat','mouse'] bro_idx = ani_sor.index(bro) sis_idx = ani_sor.index(sis)
展开全文
在努力存钱的小松鼠很矫健
发表于 2025-08-13 11:37:11
#include <iostream> using namespace std; int main() { string s1,s2; cin>>s1>>s2; if (s2=="elephant"&&
展开全文
鹿沉
发表于 2025-06-19 23:35:32
# 输赢的逻辑关系 res = [['elephant', 'tiger'], ['tiger', 'cat'], ['cat', 'mouse'], ['mouse', 'elephant']] line = input().split() # 正序匹配上,则是吃的关
展开全文
双料虾牛皇堡
发表于 2025-06-30 01:43:10
#include <stdio.h> #include <string.h> int main() { char s1[10], s2[10]; scanf("%s %s", s1, s2); if ((strcmp
展开全文
超级汉堡ham
发表于 2025-08-05 23:05:12
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in =
展开全文
裁空
发表于 2025-07-21 18:59:50
#include <iostream> using namespace std; int main() { string s1,s2; cin>>s1>>s2; if(s1=="elephant"&&s
展开全文
牛客303835616号
发表于 2025-08-13 16:53:09
a = input().split() t = 'tiger' e = 'elephant' c = 'cat' m = 'mouse' niu = a[0] mei = a[1] if niu == t: if mei == c: print ('win') eli
展开全文
何成95
发表于 2025-08-29 19:14:25
nn, nm = input().split() game = ["elephant","tiger","cat","mouse"] idn, idm = game.index(nn), game.index(nm)
展开全文
查看本题
查看本题讨论
相关比赛
5158-牛客小白月赛24
进入比赛
5494-南昌航空大学第四次新生练习赛
进入比赛
5588-牛客小白月赛24(重现赛)@我是一只傻狍子
进入比赛
6250-牛客小白月赛24(重现赛)@极为沙雕的大奶熊礽荣
进入比赛
6251-牛客小白月赛24(重现赛)@极为沙雕的大奶熊礽荣
进入比赛
等你来战
查看全部
牛客小白月赛120
报名截止时间:2025-09-05 21:00
牛客周赛 Round 108
报名截止时间:2025-09-07 21:00
牛客练习赛144
报名截止时间:2025-09-12 21:30
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题