自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(195)
  • 资源 (5)
  • 收藏
  • 关注

原创 计算两个日期之间的天数

机智题,分别算两个现在到公元的天数,相减#include int sum(int y,int m,int d){int x[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};int i,s=0;for(i=1;i<y;i++)if((i%4==0 && i%100!=0 )|| i%400==0)s+=366;//闰年elses+=365

2015-12-12 12:47:01 451

原创 迷宫问题之最短路径bfs

#include #include #include #include #include #include #include #include using namespace std;#define maxn 105#define inf 0x3f3f3f3ftypedef long long LL;int n,m;char mp[maxn][maxn];bool vi

2015-12-11 18:48:25 540

原创 CF 115B. Lawnmower

CF 115B. Lawnmower http://www.codeforces.com/problemset/problem/115/B    贪心。由于每次必须将整行的走完,而且不能变换方向,由此可知每次都是走极端。非常好的题。每次必须从端点开始扫。偶数行(0也算)从左开始奇数行从右开始往左扫。记录上一次的位置。坐标绝对值之差即为距离。#include#include

2015-11-28 13:49:51 468

原创 A 2Char

A. 2Chartime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrew often reads articles in his favorite magazine 2Char.

2015-11-17 18:40:45 435

原创 hihocoder算法复习之 线段树单点更新

hihocoder#1077 : RMQ问题再临-线段树时间限制:10000ms单点时限:1000ms内存限制:256MB描述上回说到:小Hi给小Ho出了这样一道问题:假设整个货架上从左到右摆放了N种商品,并且依次标号为1到N,每次小Hi都给出一段区间[L, R],小Ho要做的是选出标号在这个区间内的所有商品重量最

2015-11-16 18:45:58 467

转载 Codeforces Round #327 (Div. 2) (B. Rebranding 字符串的操作)

分类: 模拟 CF2015-10-26 14:22 58人阅读 评论(0) 收藏 举报B. Rebrandingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe name of one

2015-11-14 16:23:26 423

原创 华南理工大学2013级计科一班操作系统实验

实验一:进程和线程的创建1. 在linux下编写一个应用程序,命名为an_ch2_1b。这个程序不断地输出如下行:Those output come from child,[系统时间]另外写一个应用程序,命名为an_ch2_1a。这个程序创建一个子进程,执行an_ch2_1b。这个程序不断地输出如下行:Those output come from child,[系统时间]观察程

2015-10-10 00:25:14 11062 13

原创 HDU 2255 奔小康赚大钱 (KM算法 模板)

A - 奔小康赚大钱Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescription传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间

2015-08-17 11:44:44 731

原创 UVA 348 Optimal Array Multiplication Sequence(最优矩阵链乘)

L - Optimal Array Multiplication SequenceTime Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVA 348Appoint description: acmparand  (2013-08-02

2015-08-09 20:25:21 666

原创 POJ 3368 Frequent values

B - Frequent valuesTime Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3368Appoint description: bjtu_lyc  (2011-08-08)System Crawler  (

2015-08-09 11:48:13 556

原创 POJ 3264 Balanced Lineup(st或者线段树)

A - Balanced LineupTime Limit:5000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3264Appoint description: System Crawler  (2015-08-03)Des

2015-08-09 00:29:03 1135

原创 Codeforces Round #312 (Div. 2) B. Amr and The Large Array

这道题对技巧和思维都是不错的锻炼。求出现最多次数的那个数在保持出现次数不变的情况下数组的最短长度。思路:1用一个vis数组来标记数组中每个数字出现的次数,可以边输入边判断,在线性时间内处理处出现次数最多的次数。注意不是那个数,因为出现的最大次数相同的数可能有多个。2线性时间扫一遍,处理处每个数的最左和最右端点的编号和区间的长度。3线性时间再扫一遍,这次只要在出现最大次数相同的数之间比较区间,即可找出出现次数最大且长度最短的子数组。

2015-08-07 23:55:11 469

原创 Lala Land and Apple Trees

A. Lala Land and Apple Treestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr lives in Lala Land. Lala La

2015-08-07 23:22:10 800

原创 最大流 dinic算法模板

算法思想:1 bfs构造残量层次图2 dfs沿着层次的残量图找增广路3 当前弧优化,用cur[u]保存u访问到第几条边,相当于记忆化,下次就不用从u的第一条边开始#include#include#include#include#include#includeusing namespace std;#define maxn 1005#define inf 0x3f3f3f3fint

2015-08-07 15:09:56 648

原创 HDU 3549 Flow Problem

最大流的一些基本概念:1 流量flow: u->v 的流量为f,则相反方向的v->u的流量为-f2 容量cap:u->v的容量为c,但v->u的容量为0.(本来图中不存在的边容量都为0)3 残量cp=容量-流量。cp(u->v)=cap(u->v)-flow(u->v);4 增广路:在残量图中,一条从起点s到终点t的路径,且该路径上的所以残量的最小值要大于0.最大流ekrap算法的思想:(其实就是找增广路一步步逼近最大流)1不停的找增广

2015-08-06 22:47:02 488

原创 hdu 2586 How far away?

A - How far away ?Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThere are n houses in the village and some bidirectional roads

2015-08-05 23:26:36 537

原创 POJ 1330 Nearest Common Ancestors

lca的tarjan离线算法#include#include#include#include#includeusing namespace std;#define maxn 10505int fa[maxn],ance[maxn];vectorg[maxn],query[maxn];bool vis[maxn];int in[maxn];int n,m;

2015-08-05 14:48:54 433

原创 无向图的点双连通分量(tarjan模板)

#include#include#include#include#include#includeusing namespace std;#define maxn 7500#define inf 0x3f3f3f3fint n,m;int g[maxn][maxn];int clock;int low[maxn],pre[maxn];stacks;int bc;vect

2015-08-01 17:38:36 2056 1

原创 无向图的割顶和桥(tarjan模板)

#include#include#include#includeusing namespace std;#define maxn 7500#define inf 0x3f3f3f3fint first[maxn],to[maxn],nxt[maxn],e;int pre[maxn],low[maxn];int clock;int iscut[maxn];void add(in

2015-08-01 15:32:23 747

原创 POJ 2777 Count Color

C - Count ColorTime Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2777Appoint description: System Crawler  (2015-07-22)Descrip

2015-07-25 20:48:55 658

原创 poj 3468 A Simple Problem with Integers

A Simple Problem with IntegersTime Limit:5000MS     Memory Limit:131072KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYou have N integers, A1, A2, ... , AN. You need t

2015-07-23 01:31:29 739

原创 I hate it (线段树)

B - I Hate ItTime Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescription很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,

2015-07-22 23:54:53 2188

原创 POJ 3104 Drying

C - DryingTime Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3104Appoint description: System Crawler  (2015-07-17)Description

2015-07-20 23:50:42 751

原创 POJ 3273 Monthly Expense

B - Monthly ExpenseTime Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3273Appoint description: System Crawler  (2015-07-20)Descr

2015-07-20 22:32:54 501

原创 POJ 3258 River Hopscotch

思路: n高达50000, 肯定不可能是暴力枚举。我们用一个“猜”的思想,先猜这个值可以是多少,再用一个函数验证。 然后利用单调性,注意单调性是必须,不然无法进行二分搜索,猜的值满足条件,说明还可以再变小,继续二分下去。 其实这和牛顿的二分求方程的跟的思路是一样的。

2015-07-20 21:34:37 430

原创 hdu 2063 过山车

过山车Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个

2015-07-20 12:55:31 1053

原创 UVA 111 History Grading(最长公共子序列dp)

A - History GradingTime Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVA 111DescriptionBackgroundMany problems in Computer Scie

2015-07-11 01:09:37 643

原创 n皇后问题(回溯法)

#include#include#includeusing namespace std;#define maxn 10int n;bool vis[maxn];int sum;int c[maxn];bool check(int cur,int j){ if(vis[j])return false; for(int i=0;i<cur;i++){ if(j-c

2015-05-24 20:55:23 596

原创 Codeforces Round #301 (Div. 2)

#include#include#include#include#includeusing namespace std;#define maxn 1005#define inf 0x3f3f3f3fchar s1[maxn],s2[maxn];int main(){ int n; cin>>n; cin>>s1>>s2; int d=0;

2015-05-01 22:08:54 800

原创 codeforces 535

A. Tavas and Nafastime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday Tavas got his test result as an int

2015-04-20 20:38:13 601

原创 POJ 3461 Oulipo

D - OulipoTime Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3461DescriptionThe French author Georges Perec (1936–1982) once

2015-04-11 19:36:31 491

原创 POJ 2406 Power Strings

B - Power StringsTime Limit:3000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2406DescriptionGiven two strings a and b we define a*b t

2015-04-11 19:34:59 541

原创 A. Fox And Snake

A. Fox And Snaketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel starts to learn programming. The

2015-04-11 16:47:35 539

原创 Om Nom and Dark Park

Om Nom and Dark Parktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOm Nom is the main character of a game

2015-04-10 21:24:37 526

原创 poj 3122 Pie 二分(最大化平均值)

PieTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11776 Accepted: 4076 Special JudgeDescriptionMy birthday is coming up and traditionally I'm ser

2015-04-06 19:00:33 486

原创 POJ 1905 Expanding Rods

Expanding RodsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12796 Accepted: 3299DescriptionWhen a thin rod of length L is heated n degrees, it expan

2015-04-06 12:22:20 569

原创 POJ 1458 Common Subsequence(lcs)

Common SubsequenceTime Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 1458DescriptionA subsequence of a given sequence is the

2015-04-05 11:09:20 413

原创 (POJ1953)World Cup Noise(dp)

World Cup NoiseTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 16006 Accepted: 7904DescriptionBackground "KO-RE-A, KO-RE-A" shout 54.000 happy footb

2015-04-04 19:57:24 581

原创 poj 1273 Drainage Ditches(模板题)

网络流模板

2015-04-02 23:47:30 470

原创 A. New Year Transportation

A. New Year Transportationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNew Year is coming in Line World

2015-03-31 19:36:48 486

office转pdf和图片实例

office转pdf和图片

2017-01-19

substance.jar

swing美化包substance,这是比较完整的

2017-01-18

java编程题100道

java入门的100道题目,从浅到深,如果c语言或者c++入门了,完成这些题目一半以上绝对不是问题,可以让你对java的基础有所巩固

2014-07-30

acm选拔赛题目

华南理工大学大一新生acm选拔赛题目,有点难度

2014-01-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除