
LightOJ
文章平均质量分 71
tokers
所有的魅力在“习惯”面前都将无色。
展开
-
LightOJ1314---Names for Babies
1314 - Names for Babies PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MBLong time ago, there was a strange kingdom. Peoples of different religions, different cult原创 2015-04-09 20:12:57 · 745 阅读 · 0 评论 -
LightOJ1005---Rooks(简单组合数学)
A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack each other if one原创 2015-06-03 21:10:37 · 1620 阅读 · 0 评论 -
LightOJ1003---Drunk(拓扑排序判环)
One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks! He began to describe his way of drinking. So, let m原创 2015-06-03 10:38:57 · 1402 阅读 · 0 评论 -
LightOJ1006---Hex-a-bonacci(矩阵快速幂)
Given a code (not optimized), and necessary inputs, you have to find the output of the code for the inputs. The code is as follows:int a, b, c, d, e, f;int fn( int n ) { if( n == 0 ) return a;原创 2015-06-03 21:47:34 · 1086 阅读 · 0 评论 -
LightOJ1008---Fibsieve`s Fantabulous Birthday (规律)
Fibsieve had a fantabulous (yes, it’s an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts there was an N x N g原创 2015-06-05 12:25:32 · 1358 阅读 · 0 评论 -
LightOJ1007---Mathematically Hard (欧拉函数)
Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable.In this problem, you will be given two integers a and b. You have to find the summation o原创 2015-06-04 17:59:16 · 1532 阅读 · 0 评论 -
LightOJ1011---Marriage Ceremonies (状压dp)
You work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you.The job gets more difficult when people come here and give their bio-data with原创 2015-06-06 11:08:45 · 1402 阅读 · 0 评论 -
LightOJ1009---Back to Underworld (bfs染色)
The Vampires and Lykans are fighting each other to death. The war has become so fierce that, none knows who will win. The humans want to know who will survive finally. But humans are afraid of going to原创 2015-06-05 13:00:35 · 1343 阅读 · 0 评论 -
LightOJ1010---Knights in Chessboard (规律题)
Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those who原创 2015-06-08 15:25:15 · 1613 阅读 · 0 评论 -
LightOJ1016---Brush (II) (贪心)
After the long contest, Samee returned home and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found a brush in原创 2015-06-08 18:23:47 · 996 阅读 · 0 评论 -
LightOJ1017---Brush (III) (dp)
Samir returned home from the contest and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found a brush in his ro原创 2015-06-08 19:56:52 · 1394 阅读 · 0 评论 -
LightOJ1012---Guilty Prince (并查集)
Once there was a king named Akbar. He had a son named Shahjahan. For an unforgivable reason the king wanted him to leave the kingdom. Since he loved his son he decided his son would be banished in a ne原创 2015-06-07 18:09:02 · 1057 阅读 · 0 评论 -
LightOJ1013---Love Calculator (dp)
Yes, you are developing a ‘Love calculator’. The software would be quite complex such that nobody could crack the exact behavior of the software.So, given two names your software will generate the perc原创 2015-06-07 22:10:52 · 1106 阅读 · 0 评论 -
LightOJ1021---Painful Bases (状压dp)
As you know that sometimes base conversion is a painful task. But still there are interesting facts in bases.For convenience let’s assume that we are dealing with the bases from 2 to 16. The valid symb原创 2015-06-09 20:24:36 · 1419 阅读 · 0 评论 -
LightOJ1002---Country Roads (最短路变形)
I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of m原创 2015-06-02 20:27:40 · 1158 阅读 · 0 评论 -
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 · 1120 阅读 · 0 评论 -
LightOJ1030---Discovering Gold(概率dp)
You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfect 6 si原创 2015-04-29 19:25:33 · 1161 阅读 · 0 评论 -
LIghtOJ1038---Race to 1 Again(概率dp)
Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N. And he calls thi原创 2015-04-29 20:02:46 · 1199 阅读 · 0 评论 -
LightOJ1079---Just another Robbery (概率做01背包)
As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much money原创 2015-04-29 20:19:02 · 1305 阅读 · 0 评论 -
LightOJ1248---Dice (III)(概率dp)
Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, that means when you throw the dice原创 2015-04-30 16:28:27 · 1217 阅读 · 0 评论 -
LightOJ1104---Birthday Paradox (概率)
Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability原创 2015-04-30 19:29:29 · 1251 阅读 · 0 评论 -
LightOJ1151---Snakes and Ladders (高斯消元+概率dp)
‘Snakes and Ladders’ or ‘Shap-Ludu’ is a game commonly played in Bangladesh. The game is so common that it would be tough to find a person who hasn’t played it. But those who haven’t played it (unlucky原创 2015-04-30 22:08:46 · 1921 阅读 · 0 评论 -
LightOJ1265---Island of Survival (概率dp)
You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the island, the tigers and the deer. Though unfortunate but the truth is that, e原创 2015-05-05 16:42:17 · 1726 阅读 · 0 评论 -
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 · 842 阅读 · 0 评论 -
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 · 1328 阅读 · 0 评论 -
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 · 1304 阅读 · 0 评论 -
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 · 1165 阅读 · 0 评论 -
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 · 1263 阅读 · 2 评论 -
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 · 2152 阅读 · 2 评论 -
LightOJ1020(博弈)
Alice and Bob are playing a game with marbles; you may have played this game in childhood. The game is playing by alternating turns. In each turn a player can take exactly one or two marbles.Both Alice原创 2015-06-09 19:03:30 · 1220 阅读 · 0 评论