当前位置:网站首页>洛谷: P1057 [NOIP2008 普及组] 传球游戏
洛谷: P1057 [NOIP2008 普及组] 传球游戏
2022-08-06 03:36:00 【小天狼星_布莱克】
题目描述
上体育课的时候,小蛮的老师经常带着同学们一起做游戏。这次,老师带着同学们一起做传球游戏。
游戏规则是这样的:nn个同学站成一个圆圈,其中的一个同学手里拿着一个球,当老师吹哨子时开始传球,每个同学可以把球传给自己左右的两个同学中的一个(左右任意),当老师再次吹哨子时,传球停止,此时,拿着球没有传出去的那个同学就是败者,要给大家表演一个节目。
聪明的小蛮提出一个有趣的问题:有多少种不同的传球方法可以使得从小蛮手里开始传的球,传了mm次以后,又回到小蛮手里。两种传球方法被视作不同的方法,当且仅当这两种方法中,接到球的同学按接球顺序组成的序列是不同的。比如有三个同学11号、22号、33号,并假设小蛮为11号,球传了33次回到小蛮手里的方式有11->22->33->11和11->33->22->11,共22种。
输入格式
一行,有两个用空格隔开的整数n,m(3 \le n \le 30,1 \le m \le 30)n,m(3≤n≤30,1≤m≤30)。
输出格式
11个整数,表示符合题意的方法数。
输入输出样例
输入 #1复制
3 3
输出 #1复制
2
说明/提示
40%的数据满足:3 \le n \le 30,1 \le m \le 203≤n≤30,1≤m≤20
100%的数据满足:3 \le n \le 30,1 \le m \le 303≤n≤30,1≤m≤30
2008普及组第三题
边栏推荐
- KU115 PCIE bus data preprocessing board (multi-LVDS interface)
- 2022 使用Go语言构建现代 Web 应用程序实战内容课程
- 1187 Candy,xtu
- leetcode:1374. Generate an odd number of each character string
- C Student management system Delete the specified student node (general situation)
- Google Cloud Security Summit
- To build their own core, let Google pay!Google has open source 180 nm process chip
- Use BeanUtils with caution, the performance really stretches!
- The LabVIEW application window is always on top
- leetcode:20. 有效的括号
猜你喜欢

KU115 PCIE bus data preprocessing board (multi-LVDS interface)

Qixi Festival WeChat confession wall applet source code / Laravel-based confession wall WeChat applet source code

Preprocessing (in-depth understanding of C language)

Introduction to Elliptic Curves (4): Elliptic Curve Security, Compared with RSA

The third day of learning MySQL: functions (basic)

The first day of learning MySQL: MySQL overview (basic)

ALV details are reorganized2022.8.5

数字孪生实际应用案例-智慧港口篇

Entering the pit of machine learning: 2. Supervised learning

暑假集训week3-DP
随机推荐
Digital Smart Factory Solutions 47 pages
我所理解liunx下的原子操作
Introduction to Elliptic Curves (4): Elliptic Curve Security, Compared with RSA
xctf Attack and Defense World Web Master Advanced Zone upload1
Wang Qi, Secretary of the Party Committee and President of Shanghai Pudong Development Bank Changsha Branch, and Jiang Junwen, President of Huarong Xiangjiang Bank, visited Kylin Principal for investi
智能合约安全——随机数
Smart Contract Security - Random Numbers
Qt development experience tips 231-235
深度学习Course2第二周Hyperparameter tuning, Batch Normalization, Programming Frameworks习题整理
Programmer's first day at work | Daily anecdote
Lvm root partition expansion
Develop SQL editors with Monaco Editor
Preprocessing (in-depth understanding of C language)
FluentValidation
Mysql installation ask for answers
hibernate+durid参数配置错误导致的问题SQLServerException: 服务器无法继续执行该事务。说明: 10400000001
jvm: synchronized关键字不同用法产生不同的字节码
C Student Management System Print/Modify Designated Location Information
什么是固体充气轮胎(solid pneumatic tyres)?
Qt开发经验小技巧231-235