百练
Nightmare_ak
蒟蒻的求生之路
展开
-
百练 4152: 最佳加法表达式
#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<algorithm>#include<string>#include<cstring>using namespace std;const int N = 100 + 5;char ss[N];string dp[N][...原创 2019-05-16 10:50:15 · 463 阅读 · 0 评论 -
百练 4124: 海贼王之伟大航路
状压dp#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int N = 20;int mp[N][N];int dp[1 << N][N];int main(...原创 2019-06-28 23:46:14 · 374 阅读 · 0 评论 -
百练 4119: 复杂的整数划分问题
背包问题#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<cstring>#include<algorithm>#include<vector>using namespace std;typedef long long ll;const int N = 50 + 5;...原创 2019-07-01 23:38:12 · 508 阅读 · 0 评论 -
百炼 4129: 变换的迷宫
记录状态,走过的无需再走#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<queue>#include<cstring>using namespace std;const int N = 100 + 5;char s[N][N];int r, c, k, si, sj, dir[2...原创 2019-05-31 15:21:15 · 874 阅读 · 0 评论 -
百炼 4130: Saving Tang Monk
同一个S可能需要多次经过,只需杀一次。#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<algorithm>#include<queue>using namespace std;const int N = 100 + 5;char s[N][N];int si, sj, n, m,...原创 2019-05-31 14:58:24 · 382 阅读 · 0 评论 -
百练 4132: 四则运算表达式求值
#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<cstring>#include<string>#include<vector>#include<stack>using namespace std;const int N = 1e5 + 5;struct ...原创 2019-05-17 09:34:54 · 377 阅读 · 0 评论 -
百练 4144: 畜栏保留问题
贪心#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<cstring>#include<algorithm>#include<queue>using namespace std;typedef long long ll;const int N = 50000 + 5;...原创 2019-05-16 16:55:20 · 456 阅读 · 0 评论 -
百练 4149: 课程大作业
dp好题,麻烦的是需要字典序最小,每次更新dp需要进行判断。#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<algorithm>#include<cstring>#include<vector>using namespace std;const int N = 15 + ...原创 2019-05-16 15:11:20 · 926 阅读 · 0 评论 -
百练 4150: 上机
dp好题#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int N = 10000 + 5;int a[N], b[N], c[N], dp[N][4];int main(...原创 2019-05-16 13:47:42 · 240 阅读 · 0 评论 -
百练 4120: 硬币
01背包+容斥,f[j]:构成j的方案数,g[j]:除去a[i]后构成j的方案数#define _CRT_SECURE_NO_WARNINGS#include<cstdio>#include<cstring>#include<algorithm>#include<vector>using namespace std;const int...原创 2019-06-30 19:44:17 · 499 阅读 · 0 评论