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 >>继续阅读

lightoj1010

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

1010 - Knights in Chessboard

Those who are not familiar with chess knights, note that a chess knight can attack 8 positions in the board as shown in the picture below.Given an m x n chessboard where you want to place chess knights. You have to find >>继续阅读

lightoj1008

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

1008 - Fibsieve`s Fantabulous Birthday

Among these gifts there was an N x N glass chessboard that had a light in each of its cells. When the board was turned on a distinct cell would light up every second, and then go dark.Fibsieve had a fantabulou >>继续阅读

lightoj1007

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

1007 - Mathematically Hard

In this problem, you will be given two integers a and b. You have to find the summation of the scores of the numbers from a to b (inclusive). The score of a number is defined as the following function.Mathematically some >>继续阅读

lightoj1002

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

1002 - Country Roads

For example, in the above picture, if we want to go from 0 to 4, then we can chooseI 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 >>继续阅读

bzoj3229

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

3229: [Sdoi2008]石子合并

Description

在一个操场上摆放着一排N堆石子。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的得分。

试设计一个算法,计算出将N堆石子合并成一堆的最小得分。

>>继续阅读

bzoj2818

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

2818: Gcd

Description

给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对.

Input

一个整数N

>>继续阅读

bzoj2705

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

2705: [SDOI2012]Longge的问题

Description

Longge的数学成绩非常好,并且他非常乐于挑战高难度的数学问题。现在问题来了:给定一个整数N,你需要求出∑gcd(i, N)(1<=i <=N)。

Input

一个整数,为N。

>>继续阅读