- 博客(56)
- 资源 (1)
- 收藏
- 关注
原创 URAL1091---Tmutarakan Exams(dp)
University of New Tmutarakan trains the first-class specialists in mental arithmetic. To enter the University you should master arithmetic perfectly. One of the entrance exams at the Divisibility Depar
2015-05-31 13:12:26 776
原创 hdu5249---KPI(二分+树状数组)
Problem Description 你工作以后, KPI 就是你的全部了. 我开发了一个服务,取得了很大的知名度。数十亿的请求被推到一个大管道后同时服务从管头拉取请求。让我们来定义每个请求都有一个重要值。我的KPI是由当前管道内请求的重要值的中间值来计算。现在给你服务记录,有时我想知道当前管道内请求的重要值得中间值。Input 有大约100组数据。每组数据第一行有一个n(1≤n≤10000)
2015-05-31 13:10:41 876
原创 hdu5248---序列变换(二分答案+贪心)
Problem Description 给定序列A={A1,A2,…,An}, 要求改变序列A中的某些元素,形成一个严格单调的序列B(严格单调的定义为:Bi/************************************************************************* > File Name: hdu5248.cpp > Author: ALex
2015-05-31 13:08:49 1586
原创 hdu5246---超级赛亚ACMer(贪心)
Problem Description 百小度是一个ACMer,也是一个超级赛亚人,每个ACMer都有一个战斗力,包括百小度。 所谓超级赛亚人的定义,是说如果在对抗中刚好接近极限状态,那就会激发斗志,实力提升.具体来说,就是百小度现在要接受一些ACMer的挑战了,这些ACMer有n个人,第i个人的战斗力是a[i]。 百小度接下来可以自主安排与这n个ACMer的PK顺序,他要想在PK赛中赢过另外一个
2015-05-31 13:06:47 1073
原创 UVA12186--- Another Crisis (树形dp)
Description Download as PDFA couple of years ago, a new world wide crisis started, leaving many people with economical problems. Some workers of a particular company are trying to ask for an increase
2015-05-28 22:04:55 1074
原创 POJ2773---Happy 2006(容斥+二分)
Description Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9…are all relatively prime to 2006.Now your job is eas
2015-05-28 19:46:17 746
原创 hdu4059---The Boss on Mars(容斥原理+前n项的4次方和)
Problem Description On Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss.Due to no moons around Mars, the employees can only get the salaries per-year
2015-05-28 18:30:20 1013
原创 ZOJ2836---Number Puzzle(容斥原理)
Given a list of integers (A1, A2, …, An), and a positive integer M, please find the number of positive integers that are not greater than M and dividable by any integer from the given list.InputThe inp
2015-05-28 16:00:02 1035
原创 hdu5245---Joyful(期望)
Problem Description Sakura has a very magical tool to paint walls. One day, kAc asked Sakura to paint a wall that looks like an M×N matrix. The wall has M×N squares in all. In the whole problem we den
2015-05-28 13:45:03 1598
原创 UVA10325--- The Lottery (容斥)
The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many participants this time that they cannot manage all the numbers. In an urgent meet
2015-05-27 20:49:30 829
原创 Codeforces Round #305 (Div. 2)D---Mike and Feet(单调栈)
Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to n from left to right. i-t
2015-05-27 20:09:25 925
原创 Codeforces Round #305 (Div. 2)C---Mike and Frog(扩欧+乱搞)
Mike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time 0), height of Xaniar is h1 and height of Abol is h2. Each second, Mike waters Abol and Xaniar.So,
2015-05-27 20:08:18 1127
原创 hdu1796---How many integers can you find(容斥原理)
Problem Description Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example,
2015-05-26 21:34:33 691
原创 hdu4135---Co-prime(容斥原理)
Problem Description Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be co-prime or relatively prime
2015-05-26 21:02:21 596
原创 LightOJ1408---Batting Practice (期望,推公式)
After being all out for 58 and 78 in two matches in the most prestigious tournament in the world, the coach of a certain national cricket team was very upset. He decided to make the batsmen practice a
2015-05-26 20:09:24 1243
原创 UVA1347---Tour(dp,双调TSP)
dp[i][j]dp[i][j]表示在1~max(i,j)都已经被走过的情况下,第一个人在i点,第二个人在j点时,走完剩下的点还需要的最短距离 规定第一个人领先第二个人 所以dp[i][j]dp[i][j]可以转移到dp[i+1][j]dp[i + 1][j]和dp[i+1][i]dp[i + 1][i](等价于dp[i][i+1]dp[i][i + 1])/******************
2015-05-25 20:41:52 814
原创 UVA1025---A Spy in the Metro(简单dp)
dp[i][j]dp[i][j]表示时刻i,在车站j,等待的最少时间 有3中方案: 等一分钟 往左搭车 往右搭车/************************************************************************* > File Name: uva1025.cpp > Author: ALex > Mail: zchao1
2015-05-25 20:03:20 658
原创 hdu4825---Xor Sum(Trie + 贪心)
Problem Description Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意
2015-05-25 14:59:25 877
原创 UVA10003---Cutting Sticks(简单区间dp)
任意两个切割点之间无法再分割 所以如果设dp[i][j] 表示从i位置切到j位置其实没有多大意义,亲测这样会TLE dp[i][j]表示切割第i个切割点开始的位置到第j个切割点的位置结束的木棍的最小花费 时间复杂度O(n3)O(n^3)/************************************************************************* >
2015-05-21 21:53:46 595
原创 UVA11584---Partitioning by Palindromes(dp)
We say a sequence of characters is a palindrome if it is the same written forwards and backwards. For exam- ple, ‘ racecar ’ is a palindrome, but ‘ fastcar ’ is not. A partition of a sequenc
2015-05-21 18:34:19 630
原创 Codeforces Round #303 (Div. 2)
A.简单题/************************************************************************* > File Name: A.cpp > Author: ALex > Mail: [email protected] > Created Time: 2015年05月20日 星期三 09时51分15秒
2015-05-21 14:45:33 714
原创 URAL1353---Milliard Vasya's Function(简单数位dp)
Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But how can he do that if the most interesting facts such as P
2015-05-19 21:33:49 584
原创 LightOJ1287---Where to Run (概率dp)
Last night you robbed a bank but couldn’t escape and when you just got outside today, the police started chasing you. The city, where you live in, consists of some junctions which are connected by some
2015-05-18 20:25:58 1065
原创 LightOJ1274---Beating the Dataset (概率dp)
You are in a contest, and unfortunately you don’t have much time. You have one problem in hand; you just glanced at the sample output and found that it just wants ‘YES’ or ‘NO’. So, you have made anoth
2015-05-18 16:47:33 2100 2
原创 LightOJ1364---Expected Cards(概率dp+三进制状压)
Taha has got a standard deck of cards with him. In addition to the 52 regular ones, there are 2 joker cards. Every regular card has a rank and a suit. The ranks in ascending order are: A, 2, 3, 4, 5, 6
2015-05-17 21:19:44 1114
原创 LightOJ1317---Throwing Balls into the Baskets (概率dp)
You probably have played the game “Throwing Balls into the Basket”. It is a simple game. You have to throw a ball into a basket from a certain distance. One day we (the AIUB ACMMER) were playing the ga
2015-05-17 16:24:55 1251
原创 LightOJ1027---A Dangerous Maze (期望)
You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door, it can either ta
2015-05-17 15:48:20 1157 2
原创 topcoder-srm-595-div2
250分: 暴力就行了/************************************************************************* > File Name: 250.cpp > Author: ALex > Mail: [email protected] > Created Time: 2015年05月15日 星
2015-05-16 18:16:01 780
原创 POJ2452---Sticks Problem(单调栈+RMQ,方法不够优秀)
Description Xuanxuan has n sticks of different length. One day, she puts all her sticks in a line, represented by S1, S2, S3, …Sn. After measuring the length of each stick Sk (1 <= k <= n), she finds
2015-05-15 18:37:49 1277
原创 LightOJ1422---Halloween Costumes (区间dp)
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it’s Halloween, these parties are all costume parties, Gapp
2015-05-15 16:16:15 779
原创 Timus Online Judge1009---K-based Numbers(简单递推dp)
Let’s consider K-based numbers, containing exactly N digits. We define a number to be valid if its K-based notation doesn’t contain two successive zeros. For example:1010230 is a valid 7-digit number;
2015-05-14 19:12:51 731
原创 topcoder-srm-604-div2
250分:直接暴力切分字符串/************************************************************************* > File Name: 250.cpp > Author: ALex > Mail: [email protected] > Created Time: 2015年05月10日 星期日
2015-05-13 16:29:38 886
原创 POJ1947---Rebuilding Roads(树形dp,背包)
Description The cows have reconstructed Farmer John’s farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn’t have time to rebuild any extra roads,
2015-05-12 21:55:09 713
原创 POJ3345---Bribing FIPA(树形dp+背包)
DescriptionThere is going to be a voting at FIPA (Fédération Internationale de Programmation Association) to determine the host of the next IPWC (International Programming World Cup). Benjamin Bennett,
2015-05-11 21:46:20 721
原创 topcoder-srm610-div2-550(暴力乱搞)
给你一个01矩阵,求其中最大的01交替的矩阵 由于n最大才100,所以直接暴力乱搞 先求出第i行,所有列往上的合法长度,然后枚举以第j列为最左边的列,计算可以得到的最大矩阵/************************************************************************* > File Name: 2.cpp > Author: A
2015-05-11 19:38:54 832
原创 fzu2190---非提的救赎 (单调栈)
Problem Description正如你所知道从前有一个人叫s_sin,她拥有着坐拥三千舰狼的梦想!然而天不遂人愿当她踏进hentai collection的大门之后,现实让她领略到了无情。身为一个坚强的妹子,她知道即使出门大破,即使十一连抽全是R,也要坚信着“玄不救非,氪不改命”,而自己是一个欧白这样最初的信仰!有一天s_sin率领着她的舰狼们到达了某海峡,以一个N*M的矩阵表示,每一个元素为
2015-05-11 18:59:21 958
原创 hdu4193---Non-negative Partial Sums(单调队列 or 单调栈)
曾经使用了两年多的Vim,手册也翻过一遍。虽然现在不怎么用vim了,曾经的笔记还是贴出来,与喜欢vim的朋友分享。索 1. 关于Vimvim是我最喜欢的编辑器,也是linux下第二强大的编辑器。 虽然emacs是公认的世界第一,我认为使用emacs并没有使用vi进行编辑来得高效。 如果是初学vi,运行一下vimtutor是个聪明的决定。 (如果你的系统环境不是中文,而你想使用中文的vimtutor
2015-05-11 15:35:22 913
原创 hdu1505---City Game(单调栈)
Problem Description Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,fa
2015-05-10 22:22:01 552
原创 POJ1155---TELE(树形dp,背包)
Description A TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. The root of the tree is a transmitter that emits the foot
2015-05-10 21:08:46 716
原创 hdu3535---AreYouBusy(混合分组背包,有坑点)
Problem Description Happy New Term! As having become a junior, xiaoA recognizes that there is not much time for her to AC problems, because there are some other things for her to do, which makes her
2015-05-10 19:12:24 656
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人