lightoj1067

maksyuki 发表于 oj 分类,标签:
0
lightoj1067

1067 - Combinations

For example, say there are 4 items; you want to take 2 of them. So, you can do it 6 ways.Given n different objects, you want to take k of them. How many ways to can do it?

Input

Input starts with an integer T (≤ 2000), denot >>继续阅读

lightoj1062

maksyuki 发表于 oj 分类,标签:
0
lightoj1062

1062 - Crossed Ladders

InputA narrow street is lined with tall buildings. An x foot long ladder is rested at the base of the building on the right side of the street and leans on the building on the left side. A y foot long ladder is rested at the >>继续阅读

lightoj1056

maksyuki 发表于 oj 分类,标签:
0
lightoj1056

1056 - Olympics

One of the most important tasks is to build the stadium. You are appointed as a programmer to help things out in certain matters - more specifically in designing and building the athletics tracks. After some study, you find out that >>继续阅读

lightoj1054

maksyuki 发表于 oj 分类,标签: , ,
0
lightoj1054

1054 - Efficient Pseudo Code

pseudo codeSometimes it's quite useful to write pseudo codes for problems. Actually you can write the necessary steps to solve a particular problem. In this problem you are given a pseudo code to solve a problem and you >>继续阅读

lightoj1045

maksyuki 发表于 oj 分类,标签:
0
lightoj1045

1045 - Digits of Factorial

f(0) = 1 f(n) = f(n - 1) * n, if(n > 0)Factorial of an integer is defined by the following function

So, factorial of 5 is 120. But in different bases, the factorial may be different. For example, factorial of 5 in ba >>继续阅读

lightoj1043

maksyuki 发表于 oj 分类,标签:
0
lightoj1043

1043 - Triangle Partitioning

You are given ABAC and BCDE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.See the picture below.

Input

Input starts with an integer T (≤ 25), denotin >>继续阅读

lightoj1042

maksyuki 发表于 oj 分类,标签:
0
lightoj1042

1042 - Secret Origins

But we do know the story of the first time she set out to chart her own path in the time stream. Zephyr had just finished building her time machine which she named - "Dokhina Batash". She was making the final adjustments for h >>继续阅读

lightoj1041

maksyuki 发表于 oj 分类,标签:
0
lightoj1041

1041 - Road Construction

You are given the description of roads. Damaged roads are formatted as "city1 city2 cost" and non-damaged roads are formatted as "city1 city2 0". In this notation city1 and city2 are the case-sensitive names of the two citi >>继续阅读

lightoj1040

maksyuki 发表于 oj 分类,标签:
0
lightoj1040

1040 - Donation

You will be given the lengths (in meters) of cables between each pair of rooms in your house. You wish to keep only enough cable so that every pair of rooms in your house is connected by some chain of cables, of any length. The leng >>继续阅读

lightoj1035

maksyuki 发表于 oj 分类,标签:
0
lightoj1035

1035 - Intelligent Factorial Factorization

Input

Given an integer N, you have to prime factorize N! (factorial N).

Input starts with an integer T (≤ 125), denoting the number of test cases.

Each case contains an integer N (2 ≤ N ≤ 100).

Out >>继续阅读

lightoj1029

maksyuki 发表于 oj 分类,标签:
0
lightoj1029

1029 - Civil and Evil Engineer

Since the Civil Engineer is clever enough and tries to make some profit, he made a plan. His plan is to find the best possible connection scheme and the worst possible connection scheme. Then he will report the averag >>继续阅读

lightoj1020

maksyuki 发表于 oj 分类,标签:
0
lightoj1020

1020 - A Childhood Game

Both Alice and Bob know the number of marbles initially. Now the game can be started by any one. But the winning condition depends on the player who starts it. If Alice starts first, then the player who takes the last marble >>继续阅读

lightoj1019

maksyuki 发表于 oj 分类,标签:
0
lightoj1019

1019 - Brush (V)

The city they live in is divided by some junctions. The junctions are connected by two way roads. They live in different junctions. And they can go to one junction to other by using the roads only.Tanvir returned home from the cont >>继续阅读

lightoj1016

maksyuki 发表于 oj 分类,标签:
0
lightoj1016

1016 - Brush (II)

You can assume that the rope is sufficiently large. Now Samee wants to clean the room with minimum number of moves. Since he already had a contest, his head is messy. So, help him.After the long contest, Samee returned home and go >>继续阅读

lightoj1014

maksyuki 发表于 oj 分类,标签:
0
lightoj1014

1014 - Ifter Party

Now you have to find the number of piaju's each contestant ate.I have an Ifter party at the 5th day of Ramadan for the contestants. For this reason I have invited C contestants and arranged P piaju's (some kind of food, specially >>继续阅读

lightoj1012

maksyuki 发表于 oj 分类,标签:
0
lightoj1012

1012 - Guilty Prince

For simplicity, you can consider the place as a rectangular grid consisting of some cells. A cell can be a land or can contain water. Each time the prince can move to a new cell from his current position if they share a side.On >>继续阅读