•  
  • 数据结构和算法 (102)
  • Page 2

【HDU1754】I Hate It(线段树)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 09 月 20 日

很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。 (more...)

ACM中矩阵乘法的应用(与原篇有删改)

Tags:
Comments: No Comments
Published on: 2011 年 09 月 18 日

矩阵乘法真的理解的不够深!!!
-------------------------------------------------------- (more...)

【HDU1166】敌兵布阵(线段树)

Categories: 数据结构和算法
Tags: ,
Comments: No Comments
Published on: 2011 年 09 月 17 日

C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。 (more...)

【HDU1005】Number Sequence(矩阵乘法)

Categories: 数据结构和算法
Tags: ,
Comments: 2 Comments
Published on: 2011 年 09 月 16 日

A number sequence is defined as follows:
f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.
Given A, B, and n, you are to calculate the value of f(n). (more...)

【HDU1004】Let the Balloon Rise(stl map水过,哈希表)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 09 月 15 日

Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. (more...)

【HDU1003】Max Sum(最大子序列和)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 09 月 15 日

Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
题目说的不清楚,按照自己弄的一些数据测试出最终要的结果是:最长最大子序列和,如果有多个结果输出第一组。题目中没有体现出 “最长” 这一字眼。
(more...)

【HDU1002】A + B Problem II(大数加法)

Categories: 数据结构和算法
Tags: ,
Comments: No Comments
Published on: 2011 年 09 月 15 日

本来退役考研了,但是此生有幸进入区域赛场地赛,所以复出几天以了没参加过真正ACM的遗憾。从水题开始练练编码,顺便写俩常用代码。
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. (more...)

【POJ1961】Period(KMP算法,next函数)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 05 月 19 日

For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. (more...)

【POJ2406】Power Strings(KMP算法)

Categories: 数据结构和算法
Tags: , , ,
Comments: No Comments
Published on: 2011 年 05 月 18 日

Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = "" (the empty string) and a^(n+1) = a*(a^n). (more...)

【HDU3706】Second My Problem First(单调队列)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 05 月 18 日

Give you three integers n, A and B.
Then we define Si = Ai mod B and Ti = Min{ Sk | i-A < = k <= i, k >= 1}
Your task is to calculate the product of Ti (1 < = i <= n) mod B. 题意:略了吧。。。结果是求Ti模B的乘积。 (more...)

【HDU2277】Change the ball(类似贪心策略,数学计算)

Categories: 数据结构和算法
Comments: No Comments
Published on: 2011 年 05 月 17 日

Garfield has three piles of balls, each pile has unique color of following: yellow, blue, and red. Now we also know Garfield has Y yellow balls, B blue balls, and R red balls. But Garfield just wants to change all the balls to one color. (more...)

【HDU2279】File Search Tool(JAVA正则匹配)

Categories: 数据结构和算法
Tags: ,
Comments: No Comments
Published on: 2011 年 05 月 17 日

WisKey downloaded much software in winter vacation, and the disk was in a state of confusion. He wastes many times to find the file everyday. So he wants a tool to help him do this work. (more...)

【HDU3350】#define is unsafe(前缀表达式求值)

Categories: 数据结构和算法
Tags: , ,
Comments: No Comments
Published on: 2011 年 05 月 12 日

Have you used #define in C/C++ code like the code below?
#include
#define MAX(a , b) ((a) > (b) ? (a) : (b)) (more...)

«page 2 of 8»
文章归档
日历
2018年十月
« 七    
 123456
78910111213
14151617181920
21222324252627
28293031  
标签云
sina weibo
我的广告可能就是你的信息

Welcome , today is 星期五, 2018 年 10 月 19 日