上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页
摘要: ``` #include #include #include #include #include using namespace std; typedef long long ll; const int N=500005; const int inf=1e9; ll num[N],pos[N]; ll dp[N]; ll q[N]; int n,d,lim; bool check(int mind 阅读全文
posted @ 2020-05-18 23:20 晴屿 阅读(108) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include using namespace std; const int N=4005; const int inf=0x3f3f3f3f; //求这n天每天从1到m的距离和与更改道路的价值之和的最小值. int dp[N],now[N],limit[N][N],dist[N]; bool st[N]; int 阅读全文
posted @ 2020-05-18 17:26 晴屿 阅读(100) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include using namespace std; typedef long long LL; const int N = 2500001; int e[N],ne[N],idx,h[N],w[N]; int vis[N]; int dist[N]; int n,m,k; int s,t; struct Dij 阅读全文
posted @ 2020-05-18 13:30 晴屿 阅读(109) 评论(0) 推荐(0) 编辑
摘要: ``` //k可能是负数,所以斜率不在有单调性 //新加的点的横坐标还是单调递增的,但可能不是严格的 //在查询的时候:只能二分查找 //在插入的时候:将队尾不在凸包上的点删掉 //f[j]=(sumt[i]+s)*sumc[j]+f[i]-sumt[i]*sumc[i]-s*sumc[n] //f[i]=f[j]-(sumt[i]+s)sumc[j]+sumt[i]*sumc[i]+s*sumc 阅读全文
posted @ 2020-05-18 11:40 晴屿 阅读(97) 评论(0) 推荐(0) 编辑
摘要: ``` #include using namespace std; const int N=110; typedef long long ll; typedef pair pii; #define int ll int T,n,m; int in[N][N],dp[N][N]; set st; signed main() { cin>>T; while(T--) { cin>>n>>m; st.c 阅读全文
posted @ 2020-05-16 21:47 晴屿 阅读(89) 评论(0) 推荐(0) 编辑
摘要: ``` #include using namespace std; const int N= 1e6 + 5; char a[N]; int dp[N],s[N]; int main() { int t; scanf("%d", &t); while(t--) { int n, k; scanf("%d%d", &n, &k); scanf("%s", a + 1); dp[0]=dp[1]=0; 阅读全文
posted @ 2020-05-16 21:46 晴屿 阅读(73) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#include#includeusing namespace std;const int N=111111;int f[N][21];int e[N],ne[N],h[N],idx,w[N];int n,m,s,t,k;void add(int a,int b,int c){ e[idx]=b; w[idx]=c; ne[idx]=h[a];... 阅读全文
posted @ 2020-05-14 19:33 晴屿 阅读(89) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#includeusing namespace std;const int N=210;int f[N][N];int e[N],ne[N],h[N],idx,w[N];int n,m;void add(int a,int b,int c){ e[idx]=b; w[idx]=c; ne[idx]=h[a]; h[a]=idx++;}void ... 阅读全文
posted @ 2020-05-14 19:01 晴屿 阅读(105) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include #include using namespace std; const int N=50000*2; const int mod=100000000; int n,m,b; int e[N],ne[N],idx,h[N],w[N]; int fi[N]; const int inf=0x3f3f3f3 阅读全文
posted @ 2020-05-14 13:46 晴屿 阅读(87) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include using namespace std; const int N=15,M=1state[N]; bool check(int k,int state) { for(int i=0; i>i&1 && state>>i+1&1))||((state>>i&1 && !g[k][m-i]))) retu 阅读全文
posted @ 2020-05-14 13:19 晴屿 阅读(96) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页