- 博客(56)
- 收藏
- 关注
原创 UVA - 11235 Frequent values 线段树 区间合并
查Bug到凌晨系列,下次一定要写仔细呀。传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=23846#include #include #include #include #include #include #include #include using namespace std;cons
2015-07-20 03:07:29 436
原创 UVALive - 4329 Ping pong 数状数组
坑点:结果会爆int的范围。传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=13895#include #include #include #include #include #include #include #include using namespace std;const long
2015-07-19 22:37:02 404
原创 UVALive - 3027 Corporative Network 并查集
传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=33982#include #include #include #include #include #include #include #include using namespace std;const int MAXN = 200005;
2015-07-18 11:35:10 429
原创 UVALive - 3644 X-Plosives 并查集
并查集果题传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=12648#include #include #include #include #include #include #include #include using namespace std;int bin[100005];in
2015-07-18 02:26:59 550
原创 UVA 11997 - K Smallest Sums 优先队列
传送门:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3148#include #include #include #include #include #include #include #include using namespa
2015-07-18 01:57:12 506
原创 UVALive - 3135 Argus 优先队列
优先队列的应用。传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18684#include #include #include #include #include #include #include #include using namespace std;struct Node{
2015-07-17 21:51:42 433
原创 UVA - 11991 Easy Problem from Rujia Liu?
传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18696#include #include #include #include #include #include #include #include using namespace std;map >mp;void Deal_with()
2015-07-17 21:35:34 507
原创 UVA - 11995 I Can Guess the Data Structure!
基础的数据结构的应用。用三个flag分别表示是否可能是stack,queue,priority queue即可。传送门:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18700#include #include #include #include #include #include using
2015-07-17 20:44:02 641
原创 POJ 3667 Hotel 线段树 区间合并
线段树区间合并果题。传送门:http://poj.org/problem?id=3667#include #include #include #include #include #include const int MAXN = 50005;struct Node { int x,y; int maxlen; int llen,rlen;
2015-07-17 16:37:55 486
原创 HDU 3308 LCIS 线段树
题意:求一个区间最长子序列的长度对于一个区间,记录区间的最长连续子序列的长度,记录从左边开始最长连续子序列的长度,记录从右边开始最长连续子序列的长度一个区别最长连续子序列的长度 只可能是 它的左子区间 最长连续子序列的长度 或者 它的右子区间 最长连续子序列的长度 或者 左子区间和右子区间合并后中间的长度,维护从左边开始最长连续子序列的长度和从右边开始最长连续子序列的长度就是为了求左子
2015-07-17 02:11:16 464
原创 TOJ 3858 Home 搜索
裸搜就可以了。注意好边界条件。传送门:http://acm.tju.edu.cn/toj/showp3858.html#include #include #include #include #include #include int h[12],v[12];bool Map[11][11];int ans_flag;int n;void print() {
2015-07-16 22:13:34 583
原创 TOJ 3859 Letter Order
拓扑排序,就是不断找入度为0的点,然后将 所有点 与 当前点 连的边去掉。从前往后找,可以保证是字典序。传送门:http://acm.tju.edu.cn/toj/showp3859.html#include #include #include #include #include #include char a[30][30];bool vis[30];int
2015-07-16 18:22:45 480
原创 POJ 2777 线段树
My code can AC this problem just submit by C++;Left edge may be bigger than Right edge;The portal:http://poj.org/problem?id=2777#include #include #include #include #include #include con
2015-07-15 15:29:07 329
原创 TOJ 3848 Game 矩阵快速幂
Perhaps there is three people: 1 2 3(S1,S2,S3) = (S1,S2,S3)( 2 1 2)
2015-07-15 11:14:25 494
原创 TOJ 3852 Haitang1 三维树状数组
The portal:http://acm.tju.edu.cn/toj/showp3852.htmlTree Array:#include #include #include #include #include #include using namespace std;int a[45][45][45];int Insert(int x,int y,int z,in
2015-07-14 21:52:24 503
原创 TOJ 3853 Farmer Flabby
Code pattern by kuangbin;The portal:http://acm.tju.edu.cn/toj/showp3853.html#include #include #include #include #include #include using namespace std;const double eps =1e-8;const double
2015-07-14 20:05:17 416
原创 POJ 3468 A Simple Problem with Integers
Segment Tree.The portal:http://poj.org/problem?id=3468#include #include #include #include #include const int MAXN = 100005;struct Node { int Left; int Right; long long value; long long
2015-07-14 00:59:11 329
原创 HDU 1754 I Hate It
Simple segment tree;The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1754#include #include #include #include #include #include using namespace std;const int MAXN = 200005;struct N
2015-07-13 19:35:04 566
原创 HDU 1667 The Rotation Game
参考文章:http://blog.csdn.net/urecvbnkuhbh_54245df/article/details/5856756The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1667#include #include #include #include #include #include cha
2015-07-13 15:36:10 441
转载 QT5提示can not find -lGL的解决方法
http://www.xuebuyuan.com/2040774.html 这是由于 Qt5.0 默认将OpenGL加入了工程,但是在机器上没有安装OpenGL,所以jonas只需要在机器上安装OpenGL即可 。安装建立基本编译环境首先不可或缺的,就是编译器与基本的函式库,如果系统没有安装的话,请依照下面的方式安装:$ sudo apt-get in
2015-07-13 02:58:00 717
原创 TOJ 3977 Probability I
Probability dp;F[i] = (F[i] + 1) * p[i][0] + (F[i+1] + 1) * p[i][1] + (F[i+2] + 1) * p[i][2] ;The portal:http://acm.tju.edu.cn/toj/showp3977.html\//F[i] = (F[i] + 1) * p[i][0] + (F[i+1] + 1) *
2015-07-12 20:33:50 423
原创 HDU 2689 Sort it
Tree_array;The portal:http://acm.hdu.edu.cn/showproblem.php?pid=2689#include #include #include #include #include #include using namespace std;const int M = 20005;int Bit[M+5];void I
2015-07-12 19:20:43 444
原创 POJ 1990 MooFest
Need two tree array to get answer;The portal:http://poj.org/problem?id=1990#include #include #include #include #include #include using namespace std;const long long M = 20005;struct Co
2015-07-12 19:11:09 381
原创 HDU 1892 See you~
Two dimensional Tree_Array.The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1892//Two dimensional tree array.#include #include #include #include #include #include using namespace std;
2015-07-12 15:42:59 491
原创 HDU 3743 Frosh Week
I can't understanding the problem's meaning.The student's number of people is not from 1 to n.Have multiply datas.The portal:http://acm.hdu.edu.cn/showproblem.php?pid=3743#include #include #
2015-07-12 12:06:01 450
原创 Ubuntu QT5.5.0 安装
首先从http://www.qt.io/zh-hans/download-open-source/下载源文件。qt-opensource-linux-x86-5.5.0.run然后在下载目录下 终端输入: sudo chmod 700 qt-opensource-linux-x86-5.5.0.run获得执行权限后 输入: ./qt-opensource-linux
2015-07-12 10:33:34 3625
原创 HDU 1556 Color the ball
Two ways can solve it by tree array;The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1556One:#include #include #include #include #include #include using namespace std;const int
2015-07-12 00:34:04 435
原创 HDU 1166 敌兵布阵
Tree Array.The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1166#include #include #include #include #include #include using namespace std;const int M = 50005;int Bit[M << 1] ;void
2015-07-12 00:10:34 499
原创 HDU 5281 BestCoder Round #47 1002
Use greedy algorithm can solve this problem;The portal:http://acm.hdu.edu.cn/showproblem.php?pid=5281#include #include #include #include #include using namespace std;long long a[100005];l
2015-07-11 23:21:01 442
原创 HDU 5280 BestCoder Round#47 1001
Simple problem;The portal:http://acm.hdu.edu.cn/showproblem.php?pid=5280#include #include #include #include #include using namespace std;long long a[1005];long long dp[1005];void Deal_w
2015-07-11 22:20:49 504
原创 POJ 2155 Matrix
Seeing code.The portal:http://poj.org/problem?id=2155//Two dimensional Tree_Array;//Can sum Left_up's nodes in m * n Matrix;#include #include #include #include #include using namespace
2015-07-11 22:13:43 360
原创 POJ 2481 Cows
It's a tree_array problem.The portal:http://poj.org/problem?id=2481#include #include #include #include #include using namespace std;const int N = 1e5+5;const int M = 1e5+5;int Bit[M <<
2015-07-11 00:41:32 399
原创 HDU Lost Cows
The problem can use tree_array and binary_search to get answer.It's also can use force algorithm to solve it . The data of this problem is so weak.The portal:http://acm.hdu.edu.cn/showproblem.php?pi
2015-07-10 19:27:04 433
原创 HDU Stars
It's a simple tree_array problem.The portal:http://acm.hdu.edu.cn/showproblem.php?pid=1541#include #include #include #include const int M = 32005;const int N = 15005;int Bit[M<<1];void I
2015-07-10 16:20:02 561
原创 TOJ 4114 Evaluate Xor
For AC this problem ,I consult AClavin's code ,For clearly knowing the code's operational principle.I research the code ...hours.Too hard to understanding.The portal:http://acm.tju.edu.cn/toj/showp4
2015-07-10 14:16:54 423
原创 TOJ 4115 Find the number
I forget mark value = minValue ,so I get WA one day.So sad a story.The portal:http://acm.tju.edu.cn/toj/showp4115.html#include #include #include #include double minValue;long long Mod = 1e9
2015-07-09 19:57:29 511
原创 TOJ 4109 Cyuunibyou's problem
I make mistakes on this problem's meaning.So I get WA many times.So sad.The portal:http://acm.tju.edu.cn/toj/showp4109.html#include #include #include #include int even_tot,odd_tot;void Deal
2015-07-09 18:40:27 590
原创 TOJ 4108 Hearthstone
Use 0-1 backpack algorithm can solve this problem . But I use DFS.The portal:4108. Hearthstone 4108. Hearthstone#include #include #include #include int monsters[20];int magic[105];int N,M,A
2015-07-09 18:36:26 411
原创 TOJ 4104 Farm Irrigation
Deal details carefully.The portal:http://acm.tju.edu.cn/toj/showp4104.html#include #include #include #include int N,M;char Map[55][55];int mat[55][55];int bin[3000];char Judge_Right[256][
2015-07-09 18:31:52 489
原创 TOJ 4107 A simple problem
Deal details carefully.The portal:http://acm.tju.edu.cn/toj/showp4107.html#include #include #include #include void Deal_with(){ long long N,M,K; while(~scanf("%lld %lld %lld",&N,&M,&K
2015-07-09 18:27:54 570
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人