摘要:
思路:前缀和, c表示对于当前的middle, 前缀和 include using namespace std; const int maxn = 1e6+1; int n, m, now, r[maxn], d[maxn], s[maxn], t[maxn], c[maxn]; bool chec 阅读全文
摘要:
``` include using namespace std; int b[4]; int a[3]; int calc(int a, int b, int c) { if(c == 1) return a + b; else if(c == 2) return a b; else if(c == 阅读全文
摘要:
``` include using namespace std; const int maxn = 10005; set to[maxn]; queue q;int s, t;int n, m;set to2[maxn]; int dist[maxn], used[maxn], dist2[maxn 阅读全文
摘要:
``` include using namespace std; const int maxn = 200005; vector son[maxn]; int v[maxn], s[maxn], w[maxn]; int main() { freopen("input.in", "r", stdin 阅读全文
摘要:
30分做法,暴力枚举: include using namespace std; const int maxn = 400; int n, m; int a[maxn], b[maxn]; //a:格子,b:卡牌 void read() { cin n m; for(int i = 0; i a[i 阅读全文
摘要:
开始定义状态f[i][j][k]为[i,j)区间插入k个括号,使用记忆化搜索,但是成功爆栈,得到4个mle include using namespace std; const int maxn = 45; int n, k, len; long long f[maxn][maxn][maxn]; 阅读全文
摘要:
状态定义是dp中非常重要的,可以直接影响到效率,如此题,第一种思路是: include using namespace std; const int maxn = 100005; struct node { int high, value; bool operator value pf, pg; f 阅读全文