- 博客(80)
- 问答 (1)
- 收藏
- 关注
原创 Find a way HDU - 2612
Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the c
2017-05-26 00:00:02
387
原创 敌兵布阵 HDU - 1166 easy
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研究敌人究竟演习什么战术,
2017-05-25 22:22:36
339
原创 非常可乐 HDU - 1495
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (SInput三个整数 : S 可乐的体积 , N 和 M是两个杯子的容量,以"0 0 0"结束。Output
2017-05-25 20:20:01
1909
原创 Zjnu Stadium HDU - 3047 带权并查集
In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of people. The audience Seats made a circl
2017-05-24 19:31:48
478
原创 Fire! UVA - 11624
https://vjudge.net/problem/UVA-11624#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int INF = 0x3f3f3f3f;
2017-05-19 21:25:15
503
原创 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 the same length. No
2017-05-18 21:57:33
324
原创 Lazy Propagating 52C - Circular RMQ 标准模板题
C. Circular RMQtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given circular array a0, a1, ..., a
2017-05-17 23:48:02
324
原创 线段树入门第一题! I Hate It HDU - 1754
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0学生ID编号分别从1编到N。 第二行包
2017-05-17 17:37:19
916
原创 segment tree template
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int INF = 0x3f3f3f3f;const int NINF = 0xc0c0c0c0;typedef long long ll;c
2017-05-16 22:47:55
404
原创 segment tree cf197D Xenia and Bit Operations
D. Xenia and Bit Operationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the beginner programmer h
2017-05-16 22:02:29
270
原创 带权并查集 shuoj1880
1880: 等级森严Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 129 Solved: 19[Submit][Status][Web Board]Description武林,当然有拉帮结派,帮派之间还有吞并现象。那么两个人见面,常常要问,咱俩是自己人吗?如果是自己人,他们还想知道他们两个人的等级差多少。你需要做
2017-05-16 18:19:27
232
原创 Fire Game FZU - 2150
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start
2017-05-14 23:41:38
237
原创 priority_queue practice
https://vjudge.net/problem/POJ-2431http://stackoverflow.com/questions/15601973/stl-priority-queue-of-c-with-struct#include#include#include#include#include#include#include#include
2017-05-13 11:29:12
252
原创 problem
http://acm.ecnu.edu.cn/problem/3260/http://acm.ecnu.edu.cn/problem/3263/
2017-05-12 22:57:31
259
原创 A. 拼音魔法 ecnu
Time limit per test: 1.0 secondsTime limit all tests: 1.0 secondsMemory limit: 256 megabytesAccept / Submit: 341 / 2134魔法学校小学一年级有一种题。就是给一个字的拼音,给一个声调,让你正确地注音。但魔法老师给了巨量的题,你不用魔法根本不可
2017-05-12 22:07:52
716
原创 背包集合
https://vjudge.net/problem/HDU-2191#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int INF = 0x3f3f3
2017-05-11 23:05:23
228
原创 poj3414 pots 倒水模拟
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the po
2017-05-10 21:55:25
364
原创 FFT
http://202.121.199.212/JudgeOnline/problem.php?id=1966#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int IN
2017-05-09 23:12:51
431
原创 Shuffle'm Up POJ - 3087
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips.
2017-05-07 23:17:33
288
原创 Sort 归并排序求逆序对
Time limit per test: 4.0 secondsTime limit all tests: 4.0 secondsMemory limit: 256 megabytesYou want to process a sequence of n distinct integers by swapping two adjacent sequence elem
2017-05-07 23:14:21
372
转载 离散化
若一些数据本身很大,无法作为下标储存,且数据的作用只和其相对大小有关时,可以将数据进行离散化。举例说明:12345 离散化后变成 : 1 代码:// B为A的副本。sort(B,B+n);int size = unqiue(B,B+n) - B; //size为离散化后元素的个数。for(int i=0;i<n;i++) A[i] = lower_
2017-05-07 22:11:52
433
原创 Prime Path POJ - 3126
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of s
2017-05-06 23:45:02
171
原创 vim
" -----------------------------------------------------------------------------" File: gruvbox.vim" Description: Retro groove color scheme for Vim" Author: morhetz " Source: https://github.com/mor
2017-05-05 22:29:56
1417
原创 poj 1426 Find The Multiple
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there
2017-05-04 20:20:41
260
原创 poj3279 Fliptile 好题
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate anM × N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 1
2017-05-02 21:59:17
318
原创 hdu4282 A very hard mathematic problem
Haoren is very good at solving mathematic problems. Today he is working a problem like this: Find three positive integers X, Y and Z (X 1) that holds X^Z + Y^Z + XYZ = K where K is anot
2017-05-01 22:38:41
411
原创 hrbust1530 pie
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each o
2017-05-01 21:27:09
269
原创 泉水 bfs
Leyni是一个地址调查员,有一天在他调查的地方突然出现个泉眼。由于当地的地势不均匀,有高有低,他觉得如果这个泉眼不断的向外溶出水来,这意味着这里在不久的将来将会一个小湖。水往低处流,凡是比泉眼地势低或者等于的地方都会被水淹没,地势高的地方水不会越过。而且又因为泉水比较弱,当所有地势低的地方被淹没后,水位将不会上涨,一直定在跟泉眼一样的水位上。 由于Leyni已经调查过当地很久了,所以他手
2017-05-01 17:31:13
439
原创 囧字构造 模拟
https://vjudge.net/problem/HRBUST-2085需要注意的是二维数组里,x坐标和y坐标的关系。其次是先构造外边框,再构造内部,这样可以省去重复构造的步骤。(迭代)#include#include#include#include#include#include#include#include#include#i
2017-05-01 16:02:04
409
原创 hdu2065 “红色病毒” 指数型母函数
Problem Description医学界发现的新病毒因其蔓延速度和Internet上传播的"红色病毒"不相上下,被称为"红色病毒",经研究发现,该病毒及其变种的DNA的一条单链中,胞嘧啶,腺嘧啶均是成对出现的。现在有一长度为N的字符串,满足一下条件:(1) 字符串仅由A,B,C,D四个字母组成;(2) A出现偶数次(也可以不出现);(3) C出现偶数次(也可以不出现);
2017-04-30 14:08:39
328
原创 母函数(生成函数)
http://www.wutianqi.com/?p=596#include using namespace std;// Author: Tanky Woo// www.wutianqi.comconst int _max = 10001; // c1是对于每一种给定的质量,一共用多少种组合数。// c2是中间量,每次计算过一个表达式后要更新一次int c1[_max], c2
2017-04-28 21:50:10
515
原创 容器操作
构造函数c.assign(beg,en) //将[beg:en)中的元素赋予c 两个地址。大小和容量x = c.size() //x是c的元素数目c.empty() //c为空吗? 是则返回1c.reserve(n) //为c预留n个元素的空间,只适用于vector和stringc.resize(n,v) //将c的大小改变为n;将增加的元素初始化为
2017-04-24 23:49:46
216
原创 hdu2062 Subset sequence
Problem DescriptionConsider the aggregate An= { 1, 2, …, n }. For example, A1={1}, A3={1,2,3}. A subset sequence is defined as a array of a non-empty subset. Sort all the subset sequece of An in lex
2017-04-24 17:03:46
241
原创 cf 798c Mike and gcd problem
. Mike and gcd problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike has a sequence A = [a1, a2, ...
2017-04-22 11:51:26
365
原创 hdu2059 龟兔赛跑
Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社会各大名流齐聚下沙,兔子也趁此机会向乌龟发起挑战。虽然乌龟深知
2017-04-22 11:30:16
311
转载 ACM中无穷大,无穷小的设定
如果问题中各数据的范围明确,那么无穷大的设定不是问题,在不明确的情况下,很多程序员都取0x7fffffff作为无穷大,因为这是32-bit int的最大值。如果这个无穷大只用于一般的比较(比如求最小值时min变量的初值),那么0x7fffffff确实是一个完美的选择,但是在更多的情况下,0x7fffffff并不是一个好的选择。很多时候我们并不只是单纯拿无穷大来作比较,而是会运算后再做比
2017-04-21 20:27:25
1360
原创 cin cout 输入输出十六进制,八进制
hex : 十六进制oct : 八进制uppercase : 十六进制格式字母变大写showpos : 在正数前显示+号showbase : 十六进制前显示 0x, 八进制前显示0boolalpha:逻辑值1和0用ture和false 输出left : 输出内容靠左right : 输出内容靠右scientific : 科学记数法showpoint : 即使小
2017-04-21 15:48:21
3401
原创 hdu2050
Problem Description我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 Input输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0 Output对于每个测试
2017-04-19 23:35:30
209
原创 关联容器 set map
有序关联容器:基于一个序标准(默认是无需关联容器:基于一个哈希函数进行查找。这类容器用哈希表实现,采用溢出链表策略。两类容器都支持:map {键,值} set 不带值的map,或者说关键字就是值。初始化:map> locations { {"Copenhagen",{"55:40N","12:34E"}}, {"
2017-04-19 17:42:21
249
原创 vector
vector的迭代器容易失效:vector chars; constexpr int max = 20000; chars.reserve(max); vector words; //指向单词开始位置的指针因为vector声明的时候不需要声明大小,随着push_back(),元素数目增多,达到容量时,(一般容量会自动增加一半)。此时容量发生重新分配,原
2017-04-19 17:15:36
394
空空如也
HDU OJ 1004问题: C语言中有没有可以储存字符串的数组?
2016-10-28
TA创建的收藏夹 TA关注的收藏夹
TA关注的人