codeforces Codeforces Round #597 (Div. 2) Constanze's Machine 斐波拉契数列的应用
- #include<bits/stdc++.h>
- using namespace std;
- char s[];
- int dp[];
- const int MOD = 1e9+;
- int main() {
- dp[] = ;
- scanf("%s", s+);
- int N = strlen(s+);
- for(int i=; i<=N; ++i) {
- if(s[i] == 'm' || s[i] == 'w') {
- puts("");
- return ;
- }
- dp[i] = dp[i-];
- if(i!=&&(s[i] == 'n'&&s[i-]=='n' || s[i]=='u'&&s[i-]=='u'))
- dp[i] = (dp[i-]+dp[i-])%MOD;
- }
- printf("%d\n", dp[N]);
- }
- //斐波拉契数列应用
codeforces Codeforces Round #597 (Div. 2) Constanze's Machine 斐波拉契数列的应用的更多相关文章
- Codeforces Round #382 (Div. 2) C. Tennis Championship 斐波那契
C. Tennis Championship time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- [Codeforces 316E3]Summer Homework(线段树+斐波那契数列)
[Codeforces 316E3]Summer Homework(线段树+斐波那契数列) 顺便安利一下这个博客,给了我很大启发(https://gaisaiyuno.github.io/) 题面 有 ...
- Codeforces 446C - DZY Loves Fibonacci Numbers(斐波那契数列+线段树)
Codeforces 题目传送门 & 洛谷题目传送门 你可能会疑惑我为什么要写 *2400 的题的题解 首先一个很明显的想法是,看到斐波那契数列和 \(10^9+9\) 就想到通项公式,\(F ...
- BestCoder Round #71 (div.2) (hdu 5620 菲波那切数列变形)
KK's Steel Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- Codeforces 446-C DZY Loves Fibonacci Numbers 同余 线段树 斐波那契数列
C. DZY Loves Fibonacci Numbers time limit per test 4 seconds memory limit per test 256 megabytes inp ...
- codeforces gym #101161G - Binary Strings(矩阵快速幂,前缀斐波那契)
题目链接: http://codeforces.com/gym/101161/attachments 题意: $T$组数据 每组数据包含$L,R,K$ 计算$\sum_{k|n}^{}F(n)$ 定义 ...
- Codeforces Beta Round #80 (Div. 2 Only)【ABCD】
Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...
- Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】
Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...
- Codeforces Beta Round #79 (Div. 2 Only)
Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...
随机推荐
- Jquery实现挂号平台首页源码
带二级导航.轮播海报.二级联动.搜索功能.Tab选项卡 按照国际惯例先放图 index.html <!DOCTYPE html> <html lang="zh-cn&quo ...
- 带你快速了解Linux文件系统
http://www.embeddedlinux.org.cn/emb-linux/file-system/201807/03-8197.html 这篇教程将帮你快速了解 Linux 文件系统. 早在 ...
- equals 为什么要把常量写在前面?
看例子 使用str1.equals("abc"); 如果str1是null,空是没有equals方法的,会抛出空指针异常 如果"abc".equals(str1 ...
- Android View框架的draw机制
概述 Android中View框架的工作机制中,主要有三个过程: 1.View树的测量(measure) Android View框架的measure机制 2.View树的布局(layout)Andr ...
- qsort 与sort 对结构体排序实例
qsort 与sort 对结构体排序实例 #include<bits/stdc++.h> using namespace std; typedef struct { string book ...
- PDF体检报告
//Title: 个人健康管理分析报告 using System; using System.Collections.Generic; using System.Linq; using System. ...
- 自定义Redux
实现mini版redux 1. 理解redux模块 1). redux模块整体是一个对象模块 2). 内部包含几个函数 createStore(reducers) // reducers: funct ...
- vue常用插件之图片预览
v-viewer(1.4.2) 非常实用的图片预览插件,支持旋转.缩放.翻转等操作 一.npm安装 npm i v-viewer -S 二.全局引入(main.js中) import 'viewerj ...
- python语言基础3
一:python函数 是组织好的,可重复使用的,用来实现单一,或相关联功能的代码块.以前使用过的一些Python提供的内建函数,如print().max(4,18).min(100,50).当然我们自 ...
- 假期学习【六】Python网络爬虫2020.2.4
今天通过Python网络爬虫视频复习了一下以前初学的网络爬虫,了解了网络爬虫的相关规范. 案例:京东的Robots协议 https://www.jd.com/robots.txt 说明可以爬虫的范围 ...