- 博客(32)
- 收藏
- 关注
原创 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 434
原创 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 411
原创 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 318
原创 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 876
原创 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 316
原创 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 244
原创 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 418
原创 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 380
原创 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 297
原创 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 404
原创 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 282
原创 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 409
原创 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 404
原创 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 621
原创 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 491
原创 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 285
原创 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 287
原创 hdu 4506 快速幂
小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女生又拿一道数学题来请教小明,小明当然很高兴的就接受了。不过等他仔细读题以后,发现自己也不会做,这下小明囧了:如果回复说自己不懂,岂不是很没面子? 所以,他现在私下求你帮忙解决这道题目,题目是这样的: 给你n个数字,分别是a1,a
2017-07-19 19:10:56 336
原创 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 273
原创 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 248
原创 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 320
原创 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 562
原创 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 502
原创 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 325
原创 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 505
原创 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 273
原创 hdu 1166 (单点更新+区间求和+裸题)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 92235 Accepted Submission(s): 38868Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Der
2017-07-13 21:10:53 254
原创 ubuntu 16.04 安装 网易云
现在网易云官网上下载对应版本 文件名:netease-cloud-music_1.0.0-2_amd64_ubuntu16.04.deb 进入下载目录:正常安装会出现错误 解决的办法是换源 换源教程然后使用命令sudo apt-get -f installsudo dpkg -i netease-cloud-music_1.0.0-2_amd64_ubuntu16.04.debnetease
2017-07-11 22:53:38 939
原创 ubuntu 16.04 更换源
进入/etc/apt/cd /etc/apt在修改前先对 sources.list文件进行备份sudo cp sources.list sources.list.bak修改sources.list文件sudo vi sources.list删除掉sources.list的其他内容,选择任意源粘贴复制进去,这里以阿里云为例ubuntu 16.04源阿里云:deb-src http://archive.
2017-07-11 22:34:10 23528
原创 磁盘操作系统 cmd命令
DOS CMD :磁盘操作系统 不区分大小写 **cd \ 根目录 cls 清空屏幕 dir 显示目录 d: 进入D盘 cd 进入目录命令 dir 查看当前目录的文件与目录 del 删除文件 del /p xx.txt 在删除前询问是否确定删除** **Rd 删除一个目录 copy 复制一个文件 copy 1.txt e:\2.txt Md 创建目录
2017-07-08 23:24:30 757
原创 hdu 1874 畅通工程续 floyed
裸题题意:求任意两点之间的最短路径坑点:测试数据同一条路径有可能出现多次,然后值不一样,注意筛选最小边#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int mp[300][300];const int inf=20000;void init() { for(int i=0;i<
2017-07-02 00:43:50 243
原创 hdu 2095 find your present (2) 位运算
题意:找出现次数为奇数的数xor运算#include <cstdio>#include <iostream>#include <algorithm>using namespace std;int main() { int n; while(scanf("%d",&n),n) { int a,ans=0; for(int i=1;i<=n;i++)
2017-07-02 00:41:11 249
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人