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

Explain详解与实践

Basic characteristics of TL431 and oscillator circuit

A Preliminary Study of RSS Subscription to WeChat Official Account-feed43

Converts XML tags to TXT format (voc conversion for yolo convenient training)

pnpm 是凭什么对 npm 和 yarn 降维打击的

if,case,for,while

高效IO模型
SQL injection in #, - +, - % 20, % 23 is what mean?

mysql index notes

八年软件测试工程师带你了解-测试岗进阶之路
随机推荐
系统设计.秒杀系统
【MD5】采用MD5+盐的加密方式完成注册用户和登录账号
劝退背后。
FFmpeg —— 通过修改yuv,将视频转为黑白并输出(附源码)
7-1 LVS+NAT 负载均衡群集,NAT模式部署
2022支付宝C2C现金红包PHP源码DEMO/兼容苹果/安卓浏览器和扫码形式
Postgresql源码(66)insert on conflict语法介绍与内核执行流程解析
The video of machine learning to learn [update]
10 Convolutional Neural Networks for Deep Learning 3
Embedded database development programming MySQL (full)
【机器学习】21天挑战赛学习笔记(一)
The Shell function
go module的介绍与应用
XSS相关知识点
结构体指针知识要点总结
Enterprise live broadcast is on the rise: Witnessing focused products, micro-like embracing ecology
一文详解DHCP原理及配置
缓存穿透、缓存击穿、缓存雪崩以及解决方案
十一种概率分布
八年软件测试工程师带你了解-测试岗进阶之路