#include<iostream> #include<cstring> #include<queue> using namespace std; const int N=1e6; int h[N],e[N],ne[N],w[N]; int n,m; int idx; bool st[N]; int ...
分类:
其他好文 时间:
2020-01-29 12:27:30
阅读次数:
53
//dp[i][j]表示第i次从左边取,第j次从右边取的价值,所以我们可以得到状态方程 //dp[i][j]=max(dp[i-1][j]+(i+j)*a[i],dp[i][j-1]+(i+j)*a[n-j+1]) (i > 0 && j > 0 ) //dp[i][0]=dp[i-1][0]+i* ...
分类:
其他好文 时间:
2020-01-28 19:34:37
阅读次数:
68
题目大意 有$n$个坐标$(x_i, y_i)$,求任意两个坐标之间的最大曼哈顿距离。 $1 \leq n \leq 50000$,$ 1 \times 10^6 \leq x1,x2,y1,y2 \leq 1 \times 10^6$。 题解 我们把$|x_1 x_2| + |y_1 y_2|$分 ...
分类:
其他好文 时间:
2020-01-28 17:52:04
阅读次数:
58
L - Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John ...
分类:
其他好文 时间:
2020-01-28 17:16:11
阅读次数:
73
总时间限制: 1000ms 内存限制: 65536kB描述The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, ...
分类:
其他好文 时间:
2020-01-25 18:21:33
阅读次数:
81
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID ...
分类:
其他好文 时间:
2020-01-22 20:05:48
阅读次数:
73
F - Aggressive cows Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at position ...
分类:
其他好文 时间:
2020-01-22 13:14:00
阅读次数:
66
A - Cow Contest N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better th ...
分类:
其他好文 时间:
2020-01-21 00:23:35
阅读次数:
73
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<queue> 5 #include<map> 6 #include<vector> 7 #include<set> 8 #include<string> ...
分类:
其他好文 时间:
2020-01-20 15:00:37
阅读次数:
52
Til the Cows Come Home Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for ...
分类:
其他好文 时间:
2020-01-17 21:30:26
阅读次数:
83