当前位置:网站首页>信息学奥赛一本通 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;
}
边栏推荐
猜你喜欢

汇编语言之栈

【21天学习挑战赛】图像的旋转问题(二维数组)

RSS订阅微信公众号初探-feed43

4-way two-way HDMI integrated business high-definition video optical transceiver 8-way HDMI high-definition video optical transceiver

SQL query String field less than 10 how to check

7-2 LVS+DR概述与部署

8.Haproxy 搭建Web集群

打造一份优雅的简历

系统设计.秒杀系统

Y86. Chapter iv Prometheus giant monitoring system and the actual combat, Prometheus storage (17)
随机推荐
The Shell function
mysql索引笔记
SQL injection in #, - +, - % 20, % 23 is what mean?
3000字,一文带你搞懂机器学习!
转:管理是对可能性的热爱,管理者要有闯进未知的勇气
基于 SSE 实现服务端消息主动推送解决方案
图像处理之Bolb分析(一)
drools from download to postman request success
中信证券网上开户怎么开的?安全吗?
2022杭电多校联赛第五场 题解
"Introduction to nlp + actual combat: Chapter 8: Using Pytorch to realize handwritten digit recognition"
高效IO模型
Structure function exercise
[Ryerson emotional speaking/singing audiovisual dataset (RAVDESS)]
Basic characteristics of TL431 and oscillator circuit
go module的介绍与应用
2022支付宝C2C现金红包PHP源码DEMO/兼容苹果/安卓浏览器和扫码形式
Postgresql源码(66)insert on conflict语法介绍与内核执行流程解析
大型连锁百货运维审计用什么软件好?有哪些功能?
[Skill] Using Sentinel to achieve priority processing of requests