代码
文章平均质量分 85
The stroke
这个作者很懒,什么都没留下…
展开
-
已知后序和中序遍历输出先序遍历
输入:第一行给出正整数N(≤30),是树中结点的个数。随后两行,每行给出N个整数,分别对应后序遍历和中序遍历结果,数字间以空格分隔。题目保证输入正确对应一棵二叉树。输出:先序遍历结果#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5;int pre[31],l=0;void change(in...原创 2019-02-20 15:27:13 · 881 阅读 · 0 评论 -
cyt的口红
题目链接:http://henummc.top/problem.php?cid=1001&pid=0#include<cstdio>#include<cstdlib>#include<iostream>#include<vector>#include<cstring>#include<algorithm>...原创 2018-11-11 20:41:12 · 355 阅读 · 0 评论 -
HYSBZ - 1588 Treap
1588: [HNOI2002]营业额统计Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 19665 Solved: 8365[Submit][Status][Discuss]Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。 Tiger拿出了...原创 2018-11-06 21:46:43 · 131 阅读 · 0 评论 -
Treap模板
#include<cstdio>#include<iostream>#include<cmath>#include<cstring>#include<algorithm>#include<cctype>using namespace std;typedef long long ll;const int ...原创 2018-11-06 21:45:23 · 160 阅读 · 0 评论 -
POJ 1330 Nearest Common Ancestors LAC
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 35020 Accepted: 17733 DescriptionA rooted tree is a well-known data structure in computer sci...原创 2018-10-12 13:17:44 · 91 阅读 · 0 评论 -
HihoCoder 1062 map+set
描述小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢?“为什么呢?”小Hi如是问道,在他的观察中小Ho已经沉迷这个网站一周之久了,甚至连他心爱的树玩具都弃置一边。“嘿嘿,小Hi,你快过来看!”小Ho招呼道。“你看,在这个对话框里输入我的名字,在另一个对话框里,输入你的名字,再点这个查询按钮,就可以查出来……什么!我们居然有...原创 2018-09-03 22:27:52 · 104 阅读 · 0 评论 -
HDU 2586 Dijkstra 算法 + 堆优化
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23772 Accepted Submission(s): 9465 Problem DescriptionThere are n house...原创 2018-09-04 14:08:29 · 100 阅读 · 0 评论 -
最大流模板
最近学习了最大流虽然学的一般都是会简单的使用,一下是我用过的几个模板模板一sap:#include <bits/stdc++.h>/*用maze来存图*/typedef long long ll;using namespace std;const int MAXN=1100;int maze[MAXN][MAXN];int gap[MAXN],dis[MAXN...原创 2018-08-21 10:05:05 · 294 阅读 · 0 评论 -
UVA 10480 Sabotage 最大流
UVA 10480 - Sabotage (最大流)SabotageThe regime of a small but wealthy dictatorship has been abruptly overthrown by an unexpected rebellion. Because of the enormous disturbances this is causing in...原创 2018-08-21 09:41:00 · 114 阅读 · 0 评论 -
HDU 4280 Island Transport ISAP+bfs 初始化 + 栈优化
Island TransportTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 11917 Accepted Submission(s): 3802 Problem Description In the vast...原创 2018-08-20 21:23:33 · 185 阅读 · 0 评论 -
HDU 4848 Wow! Such Conquering! 深搜+强剪枝
Wow! Such Conquering!Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2556 Accepted Submission(s): 773 Problem DescriptionThere are n...原创 2018-08-13 14:34:30 · 152 阅读 · 0 评论 -
HDU 3746 Cyclic Nacklace KMP
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14866 Accepted Submission(s): 6173 Problem DescriptionCC always become...原创 2018-08-15 10:49:55 · 126 阅读 · 0 评论 -
POJ 2406 Power Strings (KMP )
Power StringsTime Limit: 3000MS Memory Limit: 65536K Total Submissions: 58112 Accepted: 24140 DescriptionGiven two strings a and b we define a*b to be their concatenation. For ...原创 2018-08-15 10:48:30 · 104 阅读 · 0 评论 -
CodeForces - 873B 01串
B. Balanced Substringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string s consisting only of characters 0 and...原创 2018-08-09 08:16:11 · 215 阅读 · 0 评论 -
CodeForces - 1000C
C. Covered Points Counttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn segments on a coordinate line; each endp...原创 2018-08-09 08:12:31 · 271 阅读 · 0 评论 -
POJ - 2785
4 Values whose Sum is 0Time Limit: 15000MS Memory Limit: 228000K Total Submissions: 29083 Accepted: 8820 Case Time Limit: 5000MS DescriptionThe SUM problem can be formulated ...原创 2018-08-09 08:10:00 · 123 阅读 · 0 评论 -
已知前序(先序)与中序输出后序
已知前序(先序)与中序输出后序:前序:1, 2, 3, 4, 5, 6(根左右)中序:3, 2, 4, 1, 6, 5(左根右)分析:因为前序(根左右)最先出现的总是根结点,所以令root为前序中当前的根结点下标(并且同时把一棵树分为左子树和右子树)。start为当前需要打印的子树在中序中的最左边的下标,end为当前需要打印的子树在中序中最右边的下标。递归打印这棵树的后序,递归出口为start &...原创 2018-07-20 21:03:33 · 1826 阅读 · 0 评论 -
Stars POJ - 2352 树状数组
Stars POJ - 2352 Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars tha...原创 2018-07-26 09:56:03 · 213 阅读 · 0 评论 -
Xylon学长的小卖部
题目链接:http://henummc.top/problem.php?cid=1001&pid=1#include<iostream>#include<string>using namespace std; //yi er san si wu liu qi ba jiu shi int flag; //标志每次判断字符串所代表数字的起始...原创 2018-11-11 20:42:42 · 273 阅读 · 0 评论 -
mmc的英语作文
题目链接:http://henummc.top/problem.php?cid=1001&pid=2#include<bits/stdc++.h>using namespace std;string s="I say to you today, my friends.And so even though we face the difficulties of toda...原创 2018-11-11 20:43:45 · 266 阅读 · 0 评论 -
世豪大佬的聚会
题目链接:http://henummc.top/problem.php?cid=1001&pid=5#include<stdio.h>int a[2050];int main(){ int n,i,t,j,f; scanf("%d",&t); while(t--) { scanf("%d",&n); ...原创 2018-11-11 20:44:55 · 202 阅读 · 0 评论 -
学习是不可能学习的
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=11#include<stdio.h>const int MAX = 1010;struct student{ char Name[30]; int Number;//学号 int Average;//平均分 int Add;//...原创 2018-12-31 15:24:53 · 879 阅读 · 1 评论 -
Xylon学长的压缩文件
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=9#include<iostream>#include<string>using namespace std; int main(){ int n,i,num; string a; cin>>n; while(n--) {...原创 2018-12-31 15:24:07 · 505 阅读 · 0 评论 -
wpb学长上楼梯
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=8#include<iostream>#include<math.h>#include<algorithm>#include<cstring>#include<queue>long long n;using...原创 2018-12-31 15:24:44 · 1087 阅读 · 0 评论 -
mmc学长的情书
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=7#include <stdio.h>#include <string.h>char str[1005];long long sum=0;int main(){ gets(str); for(int i=0;i<strlen(...原创 2018-12-31 15:25:02 · 450 阅读 · 1 评论 -
luerの切割
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=6#include <iostream>#include <cstring>#include <algorithm>#include <string>#include <cstdio>#include <...原创 2018-12-31 15:24:16 · 167 阅读 · 0 评论 -
画个圈圈诅咒你
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=5#include <bits/stdc++.h>using namespace std;const int maxn = 2e1 + 5;char Graph[maxn][maxn];void Fractal(int N, int X, int Y) ...原创 2018-12-31 15:23:36 · 2548 阅读 · 0 评论 -
zy学长的花呗账单
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=4#include <iostream>#include <stdio.h>#include <string.h>#include <math.h>//#include <map>//#include <...原创 2018-12-31 15:24:32 · 393 阅读 · 0 评论 -
mmc学长的作文
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=3#include<bits/stdc++.h>using namespace std;string s="";string ss[50000];int l=0;void init(){ string x=""; for(int i=0;i...原创 2018-12-09 22:12:00 · 274 阅读 · 0 评论 -
上一道题比这道难吧
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=2#include <bits/stdc++.h>using namespace std;#define LL long longint main(){ LL a, b, n; while (cin >> a >> b >&g...原创 2018-12-31 15:23:57 · 164 阅读 · 0 评论 -
邮局之路
题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=1#problem-anchor#include<bits/stdc++.h>using namespace std;#define ll long long//d, k, a, b, tll d, k, a, b, t;int main(){ ...原创 2018-12-31 15:22:59 · 487 阅读 · 0 评论 -
A+B Problem
#include <stdio.h>int main(){ int a, b; scanf("%d %d", &a, &b); printf("%d\n", a + b); return 0;}原创 2018-12-09 22:08:30 · 122 阅读 · 0 评论 -
poj 2761 Feed the dogs 划分树
Feed the dogsTime Limit: 6000MS Memory Limit: 65536K Total Submissions: 22814 Accepted: 7233 DescriptionWind loves pretty dogs very much, and she has n pet dogs. So Jiajia has ...原创 2018-11-08 17:24:22 · 132 阅读 · 0 评论 -
!单身夜大作战 !
题目链接:http://henummc.top/problem.php?cid=1001&pid=10#include<bits/stdc++.h> using namespace std;struct stu{ int v; int w;}a[10005];bool cmp(stu x,stu y){ if(x.v==y.v){ ...原创 2018-11-11 20:50:17 · 310 阅读 · 0 评论 -
百度云密码
题目链接:http://henummc.top/problem.php?cid=1001&pid=9#include<bits/stdc++.h>#include<iostream>#include<stdlib.h>using namespace std;char s1[405], s2[405];int a[405],b[405];...原创 2018-11-11 20:48:54 · 7362 阅读 · 0 评论 -
忘了...
题目链接:http://henummc.top/problem.php?cid=1001&pid=8#include<bits/stdc++.h>#include<iostream>#include<stdlib.h>//包含了所有C++头文件的头文件using namespace std;using namespace std;int ...原创 2018-11-11 20:47:57 · 161 阅读 · 0 评论 -
数的递推
题目链接:http://henummc.top/problem.php?cid=1001&pid=7#include<iostream>using namespace std;int a[1001];int main(){ int n; cin>>n; a[0] = 0; a[1] = 1; a[2] = 2;...原创 2018-11-11 20:46:55 · 217 阅读 · 0 评论 -
yll学姐的运动世界校园
题目链接:http://henummc.top/problem.php?cid=1001&pid=6#include<bits/stdc++.h>#include<iostream>#include<stdlib.h>//包含了所有C++头文件的头文件using namespace std;int main(){ //freope...原创 2018-11-11 20:45:56 · 1521 阅读 · 0 评论 -
Japan POJ - 3067 树状数组
Japan POJ - 3067 Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coas...原创 2018-07-26 09:54:39 · 128 阅读 · 0 评论 -
Just a Hook HDU - 1698 线段树区间更新
Just a Hook HDU - 1698 In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of th...原创 2018-07-26 09:49:40 · 150 阅读 · 0 评论