- 博客(128)
- 收藏
- 关注
原创 mac sublime 配置c++ 做个笔记给以后的自己
c++ 格式化代码cool format:进入formatter setting 修改配置; Please visit http://akof1314.github.io/CoolFormat/doc/index.html for more information[SynTidy]C++=""-A2-p-N-Y-o-T-N-k3"" Java=""-A1-p-N-Y-k3""C#=""-A1
2017-10-27 20:23:06
679
原创 mac gdb调试 解决warning: unhandled dyld version (15) [Inferior 1 (process 660) exited normally]
打开终端 运行 vim .gdbinit在里面添加set startup-with-shell off问题解决
2017-10-27 00:35:58
4047
原创 ac自动机模版
后缀数组#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int maxn=200000+100;int wa[maxn], wb[maxn], wv[maxn], Ws[maxn];int Rank[maxn], height[maxn];int sa[maxn], r[max
2017-10-24 23:41:26
341
原创 xcode 如何使用#include <bits/stdc++.h>
进入Xcode的目录 usr-》include-》c++—》v1 创建一个名为bits的文件夹 在里面添加一个stdc++.h std++.h的内容为:// C++ includes used for precompiling -*- C++ -*-// Copyright (C) 2003-2014 Free Software Foundation, Inc.//// T
2017-09-01 01:10:47
3757
1
原创 uva 307 bfs优化剪枝
题目大意:将n节木棒接成m个长度相等的木条,要求木条的长度尽可能的短#include <bits/stdc++.h>using namespace std;#define LL long long#define LD long double#define SC(t,x) static_cast<t>(x)#define AR(t) vector < t >#define PII pair
2017-08-05 20:10:11
497
原创 uva 12096 115 页
#include <iostream>#include <cstdio>#include <set>#include <vector>#include <map>#include <stack> #include <algorithm>using namespace std; #define ALL(x) x.begin(),x.end()#define INS(x) insert
2017-08-05 20:08:18
382
原创 uva 540 117 页
#include <iostream>#include <cstdio>#include <algorithm>#include <vector>#include <queue>#include <map>using namespace std;int main() {// freopen("input.txt","r",stdin); int cmt; int c
2017-08-05 20:07:38
401
原创 uva 136 120页
#include <queue>#include <cstdio>#include <iostream>#include <algorithm>#include <set>#define ll long long using namespace std;int a[3]={2,3,5};int main() { priority_queue<ll ,vector<ll>, g
2017-08-05 20:06:47
329
原创 uva 400 Unix ls 127页
#include <iostream>#include <cstdio>#include <algorithm>#include <string>using namespace std;const int maxcol=60;const int maxn=100+5;string filename[maxn];void print(string x,int len,char str)
2017-08-05 20:06:08
338
原创 51nod 1212 模板
N个点M条边的无向连通图,每条边有一个权值,求该图的最小生成树。 Input 第1行:2个数N,M中间用空格分隔,N为点的数量,M为边的数量。(2 <= N <= 1000, 1 <= M <= 50000) 第2 - M + 1行:每行3个数S E W,分别表示M条边的2个顶点及权值。(1 <= S, E <= N,1 <= W <= 10000) Output 输出最小生成树的所有边
2017-08-05 20:04:21
268
原创 Uva 514 刘汝佳141页
There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible to
2017-08-05 20:02:59
423
原创 poj 2386 bfs
DescriptionDue to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains eith
2017-08-04 04:48:02
466
原创 大一的自己
大一的我唯唯诺诺,不知道该专心做什么,今天一晚无眠,在B站上看了很久CLS的视频,启发很大,希望自己这一次不是三分钟的热度,真的要决定该做什么了,希望现在并没有很迟。 总结:大一上学期,正常学习,觉得C语言很牛逼,大学之前也没有接触过电脑编程这一块,花了半学期自己搞完了C语言,觉得没什么压力了,然后学的东西就很杂,比如没事玩一玩Ubuntu,觉得C++很好玩,没事就学C++,然后就是也没有很系统的
2017-08-04 04:18:55
493
原创 hdu 4006 优先队列
Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming i
2017-07-30 14:13:43
477
原创 zoj 2724 优先队列
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will
2017-07-30 14:12:48
454
原创 poj 3320 尺取法
Jessica’s a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas inclu
2017-07-30 14:11:55
355
原创 poj 2456 二分
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).His C (2 <= C <= N) cows don’t lik
2017-07-30 14:10:29
921
原创 poj 3061 尺取法
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subs
2017-07-29 22:04:18
358
原创 hdu 1029 Ignatius and the Princess IV
#include <cstdio>#include <algorithm>#include <iostream>#include <map>#include <vector>using namespace std;#define REP(x,l,u) for(int x = (l);x<=(u);x++)const int maxn=999999+100;void init () {
2017-07-29 22:02:52
289
原创 poj 1976 01背包
A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads decided to distribute
2017-07-26 00:52:09
461
原创 poj 3280 区间dp
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows pass by
2017-07-26 00:16:00
414
原创 hdu 1247 字典树
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary. Input Standard input consists
2017-07-21 00:20:28
333
原创 zoj 1940 模拟三维bfs
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south,
2017-07-20 20:55:58
444
原创 zoj 2100 DFS
It is spring time and farmers have to plant seeds in the field. Tom has a nice field, which is a rectangle with n * m squares. There are big stones in some of the squares. Tom has a seeding-machine. A
2017-07-20 20:52:22
324
原创 zoj 3158 DFS
Li Lei and Han Meimei love each other so much that they can not be separated for even one minute. They have promised each other to share all the happy things and delicious foods. In the Saint Valentine
2017-07-20 20:50:26
448
原创 zoj 2110 奇偶性剪枝
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone w
2017-07-20 20:46:22
447
原创 hdu 2136
Problem Description Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is 2
2017-07-20 20:41:13
675
原创 hdu 2817
Problem Description Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of ea
2017-07-20 20:38:18
531
原创 poj 3641 快速幂
Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are recog
2017-07-19 19:14:52
340
原创 poj 2524 并查集裸
There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university belie
2017-07-19 19:12:25
328
原创 hdu 4506 快速幂
小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女生又拿一道数学题来请教小明,小明当然很高兴的就接受了。不过等他仔细读题以后,发现自己也不会做,这下小明囧了:如果回复说自己不懂,岂不是很没面子? 所以,他现在私下求你帮忙解决这道题目,题目是这样的: 给你n个数字,分别是a1,a
2017-07-19 19:10:56
375
原创 zoj 1649 bfs
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel’s friends want to save
2017-07-19 19:07:29
314
原创 hdu 1518 BFS
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The first line of input contains N, the number of test cases. Each test case begins with an i
2017-07-19 19:03:56
287
原创 hdu 1372 BFS
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboar
2017-07-19 19:02:02
374
原创 51Nod - 1433 0和5 找规律
小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。Input 每个测试数据输入共2行。 第一行给出一个n,表示n张牌。(1<=n<=1000) 第二行给出n个整数a00,a11,a22,…,an−1n−1 (ai
2017-07-19 18:58:52
629
原创 hdu 2824 欧拉函数 O(nlogn) 和O(n)
裸题O(nlogn):#include <cstdio>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;const int maxn=3000000+100;int phi[maxn];void init() { for(int i=2;i<maxn;i++) phi[
2017-07-15 13:51:45
543
原创 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 the same length.Now Pudge want
2017-07-13 21:24:06
362
原创 hdu 1394 逆序对(nlgn+o(n) )
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20404 Accepted Submission(s): 12231Problem Description The inversion number of a given numb
2017-07-13 21:20:26
537
原创 hdu 1754 I Hate It (单点修改+区间最值+裸题)
Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 77423 Accepted Submission(s): 29789Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高
2017-07-13 21:13:20
308
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人