#include <set> #include <map> #include <deque> #include <queue> #include <stack> #include <cmath> #include <ctime> #include <bitset> #include <cstdio> ...
分类:
其他好文 时间:
2020-01-28 19:16:21
阅读次数:
99
#include<iostream> #include<cstring> #include<cstdio> #include<string> #include<cmath> using namespace std; const int INF=0x3f3f3f3f; const int MAXN=( ...
分类:
其他好文 时间:
2020-01-28 17:52:40
阅读次数:
61
/*题都是有一个状态转移方程式 , 只要推出方程式就问题不大了,首 先对于gameboy来说他下一秒只能 在0~10这十一个位置移动, 而对于1~9这九个位置来说他可以移动(假设他现在的位置为x)到x+1,或者x-1,或者x; 0和10这两个位置只有两个位置可以移动, 可以用dp[t][x],t秒的 ...
分类:
其他好文 时间:
2020-01-28 17:42:43
阅读次数:
88
HDU P2177 https://vjudge.net/problem/HDU-2177 内容:必败态(特殊态)为两个数中较小数等于两数之差乘以(sqrt(5)+1)/2; ...
分类:
其他好文 时间:
2020-01-28 17:35:27
阅读次数:
50
#include<iostream> using namespace std; const int N=1e5; int T,n; int a[N],b[N]; int dp[N]; int main() { cin>>T; while(T--) { cin>>n; for(int i=1;i<=n ...
分类:
其他好文 时间:
2020-01-28 17:35:08
阅读次数:
48
#include<iostream> #include<cstring> using namespace std; const int INF=0x3f3f3f3f; int t,e,f,n,dp[10010]; struct node { int p, w; //价值 重量 } no[10000] ...
分类:
其他好文 时间:
2020-01-28 17:27:44
阅读次数:
70
#include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; struct node { int w, s; int index; //储存标号 } mouse[1005]; ...
分类:
其他好文 时间:
2020-01-28 17:24:42
阅读次数:
90
题目意思:有n个人,一开始相互不认识。他们要去参加party,每次参加的人是编号在区间[l,r]内的人。参加完一次party之后,这区间内的人就会相互认识。每次会有有多少对人会新认识。那么用f[i] = j 表示 j - i的人都互相认识了,初始化f[i] = i,那么每次更新l,r话只需要找到是否 ...
分类:
其他好文 时间:
2020-01-28 17:22:09
阅读次数:
63
#include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int INF=0x3f3f3f3f; struct node{ int l,s,h; }; ve ...
分类:
其他好文 时间:
2020-01-28 15:50:15
阅读次数:
83
/* dp[i][j]=max(dp[i][j-1]+a[j],max(dp[i-1][k])+a[j]) (0<k<j) dp[i][j-1]+a[j]表示的是前j-1分成i组,第j个必须放在前一组里面。 max( dp[i-1][k] ) + a[j] )表示的前(0<k<j)分成i-1组,第j ...
分类:
其他好文 时间:
2020-01-28 15:40:55
阅读次数:
46