当前位置:网站首页>信息学奥赛一本通 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;
}
边栏推荐
猜你喜欢
随机推荐
FPGA parsing B code----serial 3
base address: environment variable
SQL interview Questions
一文详解DHCP原理及配置
JVM的内存模型简介
8.Haproxy 搭建Web集群
大型连锁百货运维审计用什么软件好?有哪些功能?
if,case,for,while
Simple operation of the file system
3000字,一文带你搞懂机器学习!
XSS相关知识点
7-3 LVS+Keepalived集群叙述与部署
7-1 LVS+NAT 负载均衡群集,NAT模式部署
什么是数字孪生智慧城市应用场景
This Thursday evening at 19:00, the fourth live broadcast of knowledge empowerment丨The realization of equipment control of OpenHarmony smart home project
Explain详解与实践
7-2 LVS+DR Overview and Deployment
Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
【源码】使用深度学习训练一个游戏
杭电多校-Slipper-(树图转化+虚点建图)









