描述 Ming is going to travel for n days and the date of these days can be represented by n integers: 0, 1, 2, …, n-1. He plans to spend m consecutive days(2 ≤ m ≤ n)in Beijing. During these m days, he intends to use the first day and another day to vis…
描述 You are given a list of integers a0, a1, …, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. 输入 The first line is an integer T, indicating the number of test cases. (1≤T≤10). For each test case: The fi…
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 863    Accepted Submission(s): 342 Problem Description Kaname Mado…
HDU 4046 Panda (ACM ICPC 2011北京赛区网络赛) Panda Time Limit: 10000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1816    Accepted Submission(s): 632 Problem Description When I wrote down this letter, you may have…
专题训练 #include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> using namespace std; ; const int INF=0x3fffffff; struct Node { int to; int next; }edge[MAXN*]; int tol; int head[MAXN]; ]; ]; ]; void init() { memset(…
题目:给出1-n连续的方格,从0开始,每一个格子有4个状态,左右脚交替,向右跳,而且每一步的步长必须在给定的区间之内.当跳出n个格子或者没有格子可以跳的时候就结束了,求出游戏的期望步数 0:表示不能到达这个格子 1:表示左脚跳进这个格子 2:表示右脚跳进这个格子 3:随意哪个脚跳进这个格子,而且下一步随意用哪个脚 dp[i][j] :表示走到第 i 个格子在 j 状态的期望. 当j=1时,你可以走到dp[i+k][2],dp[i+k][3], 当j=2时,你可以走到dp[i+k][1],dp[i…
cl少用在for循环里 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> using namespace std; #define MOD 1000000007 const int INF=0x3f3f3f3f; ; typedef l…
插板法基础知识 斯特林数见百科 #include<iostream> #include<cmath> #include<cstdio> #include<cstring> #define LL long long #define eps 1e-7 #define MOD 1000000007 using namespace std; ][]={},stir2[][]={}; int main(){ ;i<=;i++){ c[i][]=c[i][i]=;…
推出公式为:P = A(2n,n)/(2^(2n)*n!) 但是不会大数,学完java再补…
直接在字符串上搜索,注意逗号的处理 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> using namespace std; #define MOD 1000000007 #define pb(a) push_back(a) cons…