随笔分类 - ACM入门题
hdu2669 6thweek trainning problem I、数论、线性方程
摘要:Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Lovers
阅读全文
Hdu4548 6thweek contest_H 、[美素数] 筛素数、数论
摘要:Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能计算出
阅读全文
Hdu1222、 6thweek trainnig_G 最大公约数
摘要:Description There is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit
阅读全文
uva 11722 6thweek trainning_A joing with friend
摘要:UVA 11722 You are going from Dhaka to Chittagong by train and you came to know one of your old friends is going from city Chittagong to Sylhet. You al
阅读全文
Codeforces 569A 6thweek contest_C
摘要:Description Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite so
阅读全文
Codeforces 478B 6thweek contest_B
摘要:Random teams 题意: 有n个选手和m个队伍,让你分配,条件是每个队伍至少要有1个选手。分配完之后,每队伍里2个人可以组成一组,求分配完之后最多的组数和最少的组数 分析: 1. 最多的情况就是,先每个队伍分一个人,然后把剩下的全部给到一个队伍里,就是最多的情况 例如:n=10,m=3 1
阅读全文
LightOJ1317 _6thweek contest problem_A
摘要:Throwing balls into the baskets: 题目大意: 有N个人,M个篮框,K个回合,每个回合每个人可以投一颗球,每个人的命中率都是相同的P,问K回合后,投中的球的期望数是多少 分析: 每个人的投篮都是一个独立的事件,互不影响,所以每回合投中的球的期望数是相同的 只需求得一回合
阅读全文
poj 1836!!! 5th_problem_B 求最少出列的人数
摘要:Description In the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of t
阅读全文
Light OJ 1033 .5THproblem A. DP 最长回文子序列
摘要:Description By definition palindrome is a string which is not changed when reversed. "MADAM" is a nice example of palindrome. It is an easy job to tes
阅读全文
poj_1458 LCS problem F.最长上升公共子序列
摘要:Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., x
阅读全文
POJ3903 5thweek.problem_E LIS
摘要:Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is ver
阅读全文
5thweek.problem_B(zoj 1093) LIS
摘要:Description 一组研究人员正在设计一项实验,以测试猴子的智商。他们将挂香蕉在建筑物的屋顶,同时,提供一些砖块给这些猴子。如果猴子足够聪明,它应当能够通过合理的放置一些砖块建立一个塔,并爬上去吃他们最喜欢的香蕉。 研究人员有n种类型的砖块,每种类型的砖块都有无限个。第i块砖块的长宽高分别用x
阅读全文
5thweek.problem_A hdu1003最大子段和
摘要:Description 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 m
阅读全文
4thweek contest problem_E codeforces 18c前缀码之和问题
摘要:题目描述: Once Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative.
阅读全文
4thweek contest problem_B 灯笼半径问题
摘要:题目描述如下: Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the str
阅读全文
4thweek contest.A 归并排序求逆序数
摘要:题目: bobo has a sequence a 1,a 2,…,a n. He is allowed to swap two adjacent numbers for no more than k times. Find the minimum number of inversions afte
阅读全文
4thweek.P_C poj3122 二分法
摘要:分配派问题题目大意: 我要过生日了,准备了n个不同半径大小的圆形的pie,我有f 个朋友要来参加我的聚会,我要将pie公平分配,且给每人(包括我自己)分配一块尽量大的pie。(因为碎块看起来不上台面。)求分配每个人的pie的体积的最大值。(pie的厚度一定,等于1) 分析: 运用二分法:将每个人能分
阅读全文
4thweek.P_problemB .poj1505copy books.二分法
摘要:题目大意: 有m本书,k个抄写员。m本书的页码分别为 p1,p2……pm……。他们同时开始抄写且工作效率相同。要求分配给抄写员们若干书,每个抄写员要抄写的书的顺序必须是连续相邻的。 请你分配书使他们在最少的时间里完成抄写任务。 分析: 使每个抄写员分配到的页数的最大值尽可能小。最大值的最小化问题加二
阅读全文
poj2299.4thweek.p.A.归并排序
摘要:Description: In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swappin
阅读全文
3tnweek.N题:暴力+打表,求矩形个数
摘要:Description 给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格. Input 第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n < 100 , m < 100). Output 每行输出网格中有多少个矩形. Sa
阅读全文
浙公网安备 33010602011771号