- 博客(153)
- 问答 (1)
- 收藏
- 关注
原创 浙工大姗姗杯round3 A - 数塔 HDU - 2084
数塔Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 44989 Accepted Submission(s): 26700Problem Description在讲述DP算法的时候,一个经典的例子就是数
2017-07-16 13:44:06
469
原创 浙工大姗姗杯round2 G - Bad Luck Island CodeForces - 540D
D. Bad Luck Islandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Bad Luck Island is inhabited by thre
2017-07-16 13:35:01
621
原创 浙工大姗姗杯round2 CodeForces 116B Little Pigs and Wolves
B. Little Pigs and Wolvestime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputOnce upon a time there were s
2017-07-16 13:09:24
498
原创 浙工大姗姗杯round1 G - A Mathematical Curiosity HDU - 1017
A Mathematical CuriosityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41840 Accepted Submission(s): 13449Problem Description
2017-07-16 09:26:17
513
原创 浙工大姗姗杯round2 CodeForces 103B Cthulhu
B. Cthulhutime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard output...Once upon a time a man came to the sea. T
2017-07-16 09:23:51
700
原创 浙工大姗姗杯round1 F - Rikka with Parenthesis II
Rikka with Parenthesis IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1545 Accepted Submission(s): 686Problem DescriptionA
2017-07-15 11:21:26
303
原创 浙工大姗姗杯round1 E - Generating Fast UVA - 10098
UVA - 10098 - Generating FastGenerating permutation has always been an important problem in computer science. In this problem you will have to generate the permutation of a given string in asc
2017-07-15 11:05:47
1035
原创 浙工大姗姗杯round1 D - Well-known Numbers
B. Well-known Numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNumbers k-bonacci (k is integer, k
2017-07-15 10:59:56
381
原创 浙工大姗姗杯round1 C - Hello World! UVA - 11636
When you first made the computer to print the sentence “Hello World!”, you felt so happy, not knowing how complex and interesting the world of programming and algorithm will turn out to be. Then you d
2017-07-15 10:50:49
463
原创 浙工大姗姗杯round1 A - "Or" Game |CodeForces - 578B
A - "Or" Game CodeForces - 578B 题意:给n个数,再给一个x,对n个数里任意几个进行总共为k次的an*x操作,要求这n个数最后“OR”(或)结果最大。思路:有个坑点,一开始以为乘以最大的数就可以了,果然没那么简单。借别人一个反例比如 1 0 0 0 1 0 1 1 1 1 0 1 这3个数字; 假设要乘的数字x是2;只能乘1
2017-07-15 10:30:22
334
原创 Dancing link ZOJ3209
Dancing link外面的模板其实都是错的。。看了我一天纠错,其实就是link函数的D,U,L,R(上下左右)全部弄反了,不影响结果,但是会让人无法理解。另外不明白为什么非要建个结构体??#include #include using namespace std;int n, m, p, x1, y1, x2, y2;int shang[101000], xia[101000],
2017-04-18 14:23:24
317
原创 天梯赛L2-016愿天下有情人都是失散多年的兄妹
pat并查集题目太多了。这道就用了dfs写。其实用bfs+set去重写更简单,在下比较辣鸡吧#include #include #include #include #include #include using namespace std;int a, b, N, d;char c;struct person { char sex; int papa, mama;}Lu
2017-03-30 19:03:34
762
原创 51nod没过的那题
#include #include #include using namespace std;map > Lu;int a[100001], b[100001];int main(){ int n; while(cin >> n){ int x = n; for(int i = 1; i <= n; i++){ c
2017-03-16 22:05:30
294
原创 省赛Colorful Rainbows
#include #include #include #include #include using namespace std;struct straight{ double a, b;}Lu[6000], Hui[6000];bool cmp(straight x, straight y){ if(x.a != y.a) return x.a <
2017-03-08 11:25:20
315
原创 prim算法学习
#include #include #include #include using namespace std;#define INF 10000000int N, E;int sum;int town[600][1000];void prim(){ int dis[1000], vis[1000], now = 0, Min; sum = 0; mems
2017-03-07 15:08:56
282
原创 浙江第四届省赛第一题
#include #include #include #include #include using namespace std;#define inf 10000000int n, m;int dir[4][2] = {0, -1, 0, 1, 1, 0, -1, 0};int ans[5000000 + 5];int mp[1000 + 5][1000 + 5];type
2017-02-28 20:21:47
334
原创 dp矩阵连乘
#define NUM 51int p[NUM];//p[0],p[1]代表第一个矩阵,剩下只需记录矩阵的列数,因为下一个矩阵的行数都等于上一个矩阵的列数int m[NUM][NUM];int s[NUM][NUM];void MatrixChain (int n){ for (int i = 1; i <= n; i++) m[i][i] = 0; for (int r = 2;
2017-02-26 11:43:27
382
原创 迪加斯特拉
#define NUM 100#define maxint 10000//顶点个数n,源点v,有向图的邻接矩阵为c//数组dist保存从源点v到每个顶点的最短特殊路径长度//数组prev保存每个顶点在最短特殊路径上的前一个结点void dijkstra(int n, int v, int dist[], int prev[], int c[][NUM]){ int i, j; bo
2017-02-25 18:31:09
861
原创 HDU 1800
代码wa了。先放着等以后找问题#include #include #include #include using namespace std;struct Node { int num; Node *Lu[10]; Node() { num = 0; for (int i = 0; i < 10; i++) Lu[i] = NULL; }};int n;Nod
2017-02-21 11:14:50
384
原创 浙工大15新生决赛 改造字符串
#include #include using namespace std;int main() { string Lu, Hui; Hui = "QunHe"; while (cin >> Lu && EOF) { int n = Lu.length() - 1; int flag = 1; if (Lu[0] != 'Q' && Lu[n] != 'e') { p
2016-12-17 21:14:00
457
原创 浙工大15新生决赛 爆炸的男友力
#include #include using namespace std;int main() { int T, n, m; scanf("%d", &T); while (T--) { scanf("%d%d", &n, &m); int Lu[1001]; memset(Lu, 0, sizeof(Lu)); for (int i = 0; i < n; i++)
2016-12-17 20:18:34
243
原创 浙工大15新生决赛 找假币
#include #include using namespace std;int main() { int t; scanf("%d", &t); while (t--) { int Lu[8], Hui[8]; for (int i = 0; i < 7; i++) { cin >> Lu[i]; Hui[i] = Lu[i]; } sort(Hui,
2016-12-17 20:02:55
407
原创 浙工大15新生赛 M大爷与数学题(最后一题)
#include using namespace std;int k;void dfs(int x, int y) { if (x > k || y > k) { printf("%d %d\n", x, y - x); return; } dfs(y, x + y); return;}int main() { while (scanf("%d", &k) != EOF
2016-12-16 23:19:37
379
原创 浙工大15新生赛 江老板A+B
#include #include #include using namespace std;const int prime[] = { 0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };int main() { int Lu[53],
2016-12-16 19:30:41
319
原创 浙工大15新生赛 数星座
#include #include struct point { int x, y; int num;};point Lu[101][21];char Hui, Yi[501][101];int K;int vis[101];bool dfs(int a, int b) { int flag; for (int i = 1; i <= K; i++) { flag =
2016-12-16 15:07:46
339
原创 浙工大15新生赛 JLB A+B
#include #include #include using namespace std;int main() { string Lu, Hui; stack q; while (cin >> Lu >> Hui && EOF) { int l1 = Lu.length() - 1, l2 = Hui.length() - 1; int i, j, w = 0; fo
2016-12-16 14:10:23
434
原创 浙工大15新生赛 命运数
#include using namespace std;const int maxn = 51;typedef long long ll;int main() { ll Lu[maxn][maxn]; Lu[1][1] = 0; Lu[2][1] = 0; Lu[2][2] = 1; for (int i = 3; i < maxn; i++) { for (int j =
2016-12-16 09:29:08
323
原创 浙工大15新生赛 江老板的蛋糕
#include const int pi = 3.1415926;using namespace std;int main() { double D, A, B; while (cin >> D && D && EOF) { cin >> A >> B; B *= 5; D /= 2; if (D * D * pi - A - B >= 0) printf("HA
2016-12-16 09:22:30
434
原创 浙工大15新生赛 爱的密码
#include #include using namespace std;struct Hui { char s, e;}Lu[60];int vis[60], vis2[60];int main() { int n; while (scanf("%d", &n) != EOF) { memset(Lu, 0, sizeof(Lu)); memset(vis, 0, s
2016-12-16 09:17:10
313
原创 浙工大新生赛 M大爷第一定律
#include using namespace std;int main() { int x; while (cin >> x && EOF && x) { if ((x + 1) % 10 == 0) printf("%d\n", x + 1); else printf("%d\n", x); } return 0;}
2016-12-16 08:45:39
391
原创 浙工大15新生赛 串
#include #include #include using namespace std;struct Hui { char Yi[11]; int flag;}Num[100000];int main() { char Lu[100000]; int n, k; while (scanf("%d%d", &n, &k) != EOF) { for (int i =
2016-12-15 23:26:13
465
原创 浙工大15新生赛 变换的数组
#include using namespace std;int main() { int n; while (cin >> n && n && EOF) { int Lu[100001], Hui[100001]; for (int i = 1; i <= n; i++) { cin >> Lu[i]; } for (int i = 1; i <= n; i++)
2016-12-15 22:36:15
275
原创 UVa816 Abbott的复仇
#include #include #include #include #include using namespace std;const int maxn = 10;const char* dirs = "NESW"; //进入的四个方向;const char* turns = "FLR"; //可以转向的三种方式;const int dr[] = { -1, 0, 1,
2016-12-12 22:03:22
493
转载 UVa 10129 欧拉路
#include #include using namespace std;const int maxn = 26;int vis[maxn], l[maxn][maxn], start[maxn], endd[maxn];void dfs(int u) { vis[u] = 1; for (int i = 0; i < maxn; i++) { if (l[maxn][maxn
2016-12-12 20:59:38
414
原创 UVa 交换学生
#include #include using namespace std;map Lu;char Hui, Yi;int main(){ int n; scanf("%d", &n); int num = 0; for (int i = 1; i <= n; i++){ cin >> Hui >> Yi; if (Lu[Yi] == Hui){ num++;
2016-11-25 20:58:51
454
原创 UVa 卡片游戏
#include #include using namespace std;queue que;int main(){ int n; scanf("%d", &n); for (int i = n; i >= 1; i--) que.push(i); while(que.size() - 1){ printf("%d ", que.front()); que.pop()
2016-11-25 20:47:05
520
原创 UVa 1594 Ducci
#include #include using namespace std;int Lu[5], flag;int main(){ for (int i = 1; i <= 4; i++){ scanf("%d", &Lu[i]); } int i; for (i = 1; i <= 1000; i++){ flag = 0; int m = Lu[1]; for
2016-11-25 20:30:50
274
原创 算法竞赛入门第二版 4-1
#include #include using namespace std;char Lu, red[8][8];int black[8][8], Hui[8][2];int n, x, y, a, b, mark,w,e;int main(){ while (scanf("%d", &n)){ int flag = 0, e = 0; memset(red, 0, size
2016-11-22 14:32:00
269
原创 算法竞赛入门经典第二版 4 - 2
因为没有题目,所以我只是按照书上描述的写的,输入输出可能有点差错#include #include using namespace std;int Lu[10][10], n, sum = 0;//检验正方形边长1~n - 1各种可能情况下是否能构成正方形void dfs(int x, int y){ int len = 1, flag; if (Lu[x + 1][y] !=
2016-11-22 12:18:19
348
原创 HDU ACM 16 2585 hotel
#include #include using namespace std;char hotel[100], Lu[100];int len, len1;bool dfs(int a, int b){ if (a == len1 && b == len) return true; if (a == len1 || b == len) return false; if (ho
2016-11-19 11:04:28
334
空空如也
ACM的水题。明明运行正确,但提交就是wrong answer呐,大佬求教
2016-10-09
TA创建的收藏夹 TA关注的收藏夹
TA关注的人