FZU 2109 Mountain Number】的更多相关文章

Mountain Number One integer number x is called "Mountain Number" if: (1) x>0 and x is an integer; (2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal to a[2i] and a[2i+2](if exists). For exampl…
http://acm.fzu.edu.cn/problem.php?pid=2109 题意:找出区间[l,r]内满足奇数位的数字大于相邻偶数位数字的个数. 典型的数位dp了,记录一下当前位是奇数位还是偶数位. 状态设计为到当前位为(奇数还是偶数的条件下上一位数字为x的)满足条件的 个数. #include<cstdio>#include<cstring>#include<algorithm>;];;        ;    }    ;    ; ;    ;i<…
Accept: 189    Submit: 461Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description One integer number x is called "Mountain Number" if: (1) x>0 and x is an integer; (2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is posit…
Mountain NumberFZU-2109 题目大意:一个大于0的数字x,分写成x=a[0]a[1]a[2][3]..a[n]的形式,(比如x=1234,a[0]=1,a[1]=2,a[3]=3,a[3]=4),Mountain Number要满足对于a[2*i+1]要大于等于a[2*i]和a[2*i+2],给定范围l,r问,有多少个Mountain Number 就简单的数位dp,照着题意写就行,而且求的是数字,前导0并没有任何影响,对于全0的情况,我们把0也特别视为Mountain Nu…
C - Prime number or not Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice FZU 1649 Description Your task is simple.Give you a number N, you should judge whether N is a prime number or not. Input There…
  http://acm.fzu.edu.cn/problem.php?pid=2111  Problem 2111 Min Number Accept: 572    Submit: 1106Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description Now you are given one non-negative integer n in 10-base notation, it will only cont…
Problem 1853 Number Deletion Accept: 80    Submit: 239 Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description Given you one n-digital positive integer a,After removing any of them k( k < n) digits, the remaining figures form a new posi…
 Problem Description One integer number x is called "Mountain Number" if: (1) x>0 and x is an integer; (2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal to a[2i] and a[2i+2](if exists). For e…
最全DP总结 https://blog.csdn.net/cc_again/article/details/25866971 ACM题集 https://blog.csdn.net/liuqiyao_01/article/details/9079611 数位dp模板讲解 https://blog.csdn.net/wust_zzwh/article/details/52100392 Mountain Number FZU - 2109 windy数 HYSBZ - 1026 状压dp https…
题目传送门 /* 数学:假设取了第i个,有C(n-1)(i-1)种取法 则ans = sum (C(n-1)(i-1)) (1<i<=n) 即2^(n-1) */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3…