- 博客(299)
- 收藏
- 关注
原创 中国高校计算机大赛(cccc)2017 总结
这次CCCC比上一次简单不少,居然拿了个一等奖,还是国家级,教育部盖章,笑。比赛延迟了一个小时10分钟,让我多睡了个好觉,坐车坐得有些晕车了,正好补回来。以前比赛前总是紧张不行,现在竟然睡得着,变化令我自己也难以相信。L1题目里面有道题少拿了4分,当时我直接往下做题了,以至于我现在那是什么题都想不起来,非常惭愧。L2题目题目二读完题目发现不太好做,上排行一看,果然没多少人做,放弃了
2017-03-26 19:37:58
6916
1
原创 MVC框架
MVC框架模型(model) , 视图(view) , 控制器(controller) 进行业务逻辑 , 数据 , 界面显示 , 分离的方法MVC用于映射传统的输入处理输出功能 M指业务模型, V指用户界面, C指控制器。MV实现了代码分离,使得可以有不同的表现形式,C用于确保MV同步
2017-03-17 22:06:25
613
原创 POJ 3986 数位dp
#include #include #include using namespace std;const int mod = 1000000003;const int maxn = 1 << 6;int n, k, inp[maxn], dp[maxn][maxn][2], pw[maxn];long long solve(int i, int pre, int len){ lo
2016-11-19 09:55:19
830
原创 POJ 3688 博弈与背包
#include #include using namespace std;const int maxn = 1E5 + 10;int inp[maxn], dp[maxn][2], n, m;int main(int argc, char const *argv[]){ while (~scanf("%d%d", &n, &m) && n + m) { for (int i
2016-11-19 09:53:31
476
原创 POJ 2287 贪心
#include #include #include using namespace std;const int maxn = 1010;int Tian[maxn], King[maxn], n;int main(int argc, char const *argv[]){ while (~scanf("%d", &n) && n) { for (int i = 0; i
2016-11-19 09:52:49
435
原创 POJ 1387 线段树
#include #include using namespace std;const int maxn = 100000;struct Event{ int x, y1, y2; int add;};struct IntervalTreeNode{ int count, total;};int n;struct Rectangle{ int x1, y1, x2,
2016-11-19 09:52:07
585
原创 POJ 2499
#include int T, a, b, kase;int main(int argc, char const *argv[]){ scanf("%d", &T); while (T--) { scanf("%d%d", &a, &b); int l = 0, r = 0; while (true) { if (a > b) { l += a /
2016-11-19 09:51:13
439
原创 2016 ccpc 合肥 赛后感
2016ACM-CCPC(合肥站)周熙威比赛总结 先说总结:这场比赛开场卡题严重,低档题卡题太久,最后一小时没能再出题,就没能拿到银牌。 开场I题是简单题,求区间(a,b)之间两数位或最大值。我和马禺喆一起想的,大约是从前到后找到a和b上第一个位不同,后面置1,但是错了,马禺喆继续调I题,我去看了H,H题题意有点记不清了,思路大约是预处理+二分,但实现出了些问题,就一直
2016-10-21 13:14:33
1266
原创 uva 1371 dp+二分
#include #include #include using namespace std;const int maxn = 5050;const int maxl = 55;const int INF = 0x3f3f3f3f;int T, n, m, dp[maxn][maxl];char str1[maxn], str2[maxl];bool judge(int mid)
2016-08-24 20:54:07
638
原创 uva 12222 dp+细节
#include #include #include #include using namespace std;const int maxn = 205;const int INF = 0x3f3f3f3f;struct Car{ int t, d; void read() { scanf("%d%d", &t, &d); }};vectorA, B;int T,
2016-08-24 12:04:50
488
原创 uva 1443 dp+二分
#include #include #include using namespace std;const int maxn = 4E5 + 10;const int INF = 0x3f3f3f3f;int init[maxn], sum[maxn], dp[maxn][2], n, m, d, T;bool check(int x){ memset(dp, INF, sizeo
2016-08-23 21:18:44
535
原创 uva 1379 dp 贪心思想降低空间复杂度
#include #include #include using namespace std;#define now d[i]const int maxg = 210;int p[maxg][maxg], d[maxg], f[2][6][6][6][6], b[maxg][maxg], n, m, g, T;struct Node{ int id, x; bool opera
2016-08-22 21:14:05
554
原创 uva 10271 dp
#include #include #include using namespace std;const int maxn = 5050;const int maxk = 1010;const int INF = 0x3f3f3f3f;int T, k, n, init[maxn], dp[maxn][maxk];int main(int argc, char const *arg
2016-08-22 12:47:11
341
原创 uva 12589 dp
#include #include #include using namespace std;const int maxn = 55;struct Node{ int x, y; bool operator < (const Node &b) const//斜率排序 { if (y * b.x == b.y * x) return x > b.x; return y *
2016-08-20 11:53:51
417
原创 uva 1543 dp
#include #include #include #include using namespace std;const int maxn = 55;int n, m;double dp[maxn][maxn][maxn], p[maxn];double fun(double x1, double x2){ return sin(min(x1 - x2, 1 - (x1 -
2016-08-19 21:34:29
505
原创 uva 1633 状态dp
#include <cstdio>#include <cstring>using namespace std;const int maxn = 410;const int maxm = 1 << 11;const int MOD = 1E9 + 7;int dp[maxn][maxm], T, n, k;bool check(int ks, int kn){ for (int
2016-08-17 22:14:29
567
原创 uvalive 6864 扫描线和技巧
uvalive 6864 扫描线和技巧#include <cstdio>#include <cstring>#include <vector>#include <cstdlib>#include <algorithm>using namespace std;const int maxn = 110;struct Rectangle{ int x, y, p, d; v
2016-08-17 21:32:01
642
原创 uva 10641 dp
#include #include #include using namespace std;const int maxn = 110;const double eps = 1e-6;const int INF = 0x3f3f3f3f;int n, m, dp[maxn], c;bool flag[maxn];struct Point{ double x, y; Poin
2016-08-16 20:12:08
547
原创 QuickHull 快速凸包
#include #include #include using namespace std;struct Point{ double x, y; Point(double x = 0, double y = 0): x(x), y(y) {}};typedef Point Vector;typedef vector Polygon;double Cross(Vector
2016-05-24 19:54:17
3321
原创 UVA 1220 树形dp
#include using namespace std;const int INF = 0x3f3f3f3f;const int maxn = 2E2 + 10;vectorv[maxn];mapmp;int dp[maxn][3], n, tol;bool vis[maxn][3];void Treedp(int u){ if (v[u].size() == 0) {dp[
2016-05-24 15:06:57
367
原创 HDU 4819 二维线段树
#include #include #include #include #include const int maxn = 1E3 + 10;const int INF = 0x3f3f3f3f;using namespace std;struct Nodey{ int l, r; int Max, Min;};int locy[maxn], locx[maxn];st
2016-05-22 11:21:12
469
原创 HDU 4727 水题
#include #include const int maxn = 1E5 + 10;int T, n, inp[maxn], kase;int main(int argc, char const *argv[]){ scanf("%d", &T); while (T--) { scanf("%d", &n); for (int i = 0; i < n; i++)
2016-05-21 21:31:50
389
原创 HDU 4726 贪心
#include #include #include using namespace std;const int maxn = 1E6 + 10;char str1[maxn], str2[maxn], ans[maxn];int a[10], b[10], T, kase;vector>W[10], K[10];//W without 0,K within 0;void init
2016-05-21 21:29:42
457
原创 HDU 4722 规律
#include #include using namespace std;const int maxn = 20;int T, kase;long long a, b;int main(int argc, char const *argv[]){ // init(); scanf("%d", &T); while (T--) { scanf("%lld%lld", &a
2016-05-21 21:24:48
369
原创 HDU 4720 模拟退火
#include #include #include #include using namespace std;struct Point{ double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} void read() { scanf("%lf%lf", &x, &y); }};typedef Poi
2016-05-21 21:21:58
442
原创 HDU 4717 三分
#include #include #include #include using namespace std;const int maxn = 3E2 + 10;const double eps = 1E-8;int n, T, kase;struct Point{ double x, y; Point(double x = 0, double y = 0): x(x),
2016-05-21 21:17:03
363
原创 HDU 4302 优先队列
#include #include #include #include using namespace std;const int INF = 0x3f3f3f3f;priority_queue, greater >r;priority_queue, less >l;int T, kase, n, L, t, cur, ans, num;int main(int argc, ch
2016-05-19 15:59:31
417
原创 HDU 5612 dfs
#include #include #include const int maxn = 100 + 10;const double eps = 1E-8;const int dir[][2] = {1, 0, 0, 1, -1, 0, 0, -1};char str[maxn][maxn];bool vis[maxn][maxn];int n, m, T;double sum;
2016-05-17 20:16:27
336
原创 HDU 5616 枚举子集
#include #include const int maxn = 100 + 10;int T, kase, n, m, k, inp[maxn], vis[maxn * maxn * 3];int main(int argc, char const *argv[]){ scanf("%d", &T); while (T--) { scanf("%d", &n); kase
2016-05-17 20:15:10
530
原创 HDU 2612 简单bfs
#include #include #include #include using namespace std;const int maxn = 2E2 + 10;const int INF = 0x3f3f3f3f;const int dir[][2] = {1, 0, 0, 1, -1, 0, 0, -1};int n, m, mp[maxn][maxn][2], dis[ma
2016-05-17 20:13:09
344
原创 HDU 5676 贪心
#include #include using namespace std;const int maxn = 1E6 + 10;long long res[maxn], n, len, T;void dfs(int a, int b, long long x){ if (a == b && x) res[len++] = x; if (a < 9) dfs(a + 1, b, x
2016-05-17 20:10:11
386
原创 HDU 1044 bfs+dfs
#include #include #include #include using namespace std;#define check(x,y) x>=0&&x=0&&y<m&&!vis[x][y]&&mp[x][y]!='*'const int maxn = 50 + 10;const int dir[4][2] = { -1, 0, 1, 0, 0, -1, 0, 1};i
2016-05-17 20:06:35
342
原创 HDU 1560 IDA*
#include #include const int maxn = 10;const char DNA[] = {"ACGT"};char str[maxn][maxn];int T, n, m, len[maxn], res[maxn];bool dfs(int* cur, int x, int dep){ int tmp[maxn]; for (int i = 0; i <
2016-05-17 20:02:26
408
原创 ZOJ 2412 dfs
#include #include #include using namespace std;const int dir[4][2] = {{0, 1}, {1, 0}, {0, -1}, { -1, 0}};const int wat[][4] = {0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1,
2016-05-12 22:31:43
347
原创 ZOJ 1649 BFS
#include #include #include using namespace std;const int INF = 0x3f3f3f3f;const int maxn = 2E2 + 10;const int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, { -1, 0}};struct Node{ int x, y; int
2016-05-12 21:48:05
467
原创 POJ 1222 高斯消元法解开关问题
#include #include #include const int maxn = 30;int inp[maxn + 5][maxn + 5], kase, T;void gauss(){ for (int i = 0; i < maxn; i++) { int k = i; while (k < maxn && !inp[k][i])k++; for (int
2016-05-10 21:30:30
939
原创 POJ 2773 容斥与二分
#include #include const int maxn = 1E6 + 10;int p[maxn], cnt, m, k;void init(){ cnt = 0; for (int i = 2; i * i <= m; i++) if (m % i == 0) { p[cnt++] = i; while (m % i == 0) {m /= i;}
2016-05-10 15:55:26
444
原创 HDU 1796 容斥
#include #include #include using namespace std;const int maxn = 25;long long ans, inp[maxn];int n, m, t, len;long long gcd(long long a, long long b){ return b == 0 ? a : gcd(b, a % b);}long
2016-05-09 22:40:37
455
原创 0-1 背包 改良版
#include #include using namespace std;const int maxn = 200;template void Traceback(int n,Type w[],Type v[],Type p[maxn][maxn],int *head,int x[]);template Type Knapsack(int n,Type c,Type v[],Typ
2016-05-09 17:19:41
780
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人