当前位置:网站首页>信息学奥赛一本通 1312:【例3.4】昆虫繁殖
信息学奥赛一本通 1312:【例3.4】昆虫繁殖
2022-08-04 04:24:00 【早睡身体好hh】
题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1312
#include <iostream>
using namespace std;
typedef long long ll;
const int N = 60;
ll cheng[N], luan[N];
int main()
{
int x, y, z;
cin >> x >> y >> z;
z++;
for (int i = 1; i <= x; i++)
{
cheng[i] = 1;
luan[i] = 0;
}
for (int i = x + 1; i <= z; i++)
{
luan[i] = cheng[i - x] * y;
cheng[i] = cheng[i - 1] + luan[i - 2];
}
cout << cheng[z] << endl;
return 0;
}
边栏推荐
- 42. 接雨水
- 自定义通用分页标签01
- 张量篇-应用案例
- 【21天学习挑战赛】直接插入排序
- 【 observe 】 super fusion: the first mention of "calculate net nine order" evaluation model, build open prosperity of power network
- 深度学习之 10 卷积神经网络3
- "Introduction to nlp + actual combat: Chapter 8: Using Pytorch to realize handwritten digit recognition"
- RSS订阅微信公众号初探-feed43
- Based on the statistical QDirStat Qt directory
- Mobile payment online and offline payment scenarios
猜你喜欢
随机推荐
Significant differences between Oracle and Postgresql in PLSQL transaction rollback
Introduction to the memory model of the JVM
如何简化现代电子采购的自动化?
3000字,一文带你搞懂机器学习!
centos 安装postgresql13 指定版本
Deep learning -- CNN clothing image classification, for example, discussed how to evaluate neural network model
if,case,for,while
SQL injection in #, - +, - % 20, % 23 is what mean?
2.15 keil使用电脑端时间日期
2022支付宝C2C现金红包PHP源码DEMO/兼容苹果/安卓浏览器和扫码形式
结构体指针知识要点总结
如何动态添加script依赖的脚本
How to automatically export or capture abnormal login ip and logs in elastic to the database?
【源码】使用深度学习训练一个游戏
复现20字符短域名绕过
软件测试如何系统规划学习呢?
[Skill] Using Sentinel to achieve priority processing of requests
中信证券网上开户怎么开的?安全吗?
Eight guiding principles to help businesses achieve digital transformation success
8.Haproxy 搭建Web集群