lightoj1183

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

1183 - Computing Fast Average

1 i j v - change the value of the elements from ith index to jth index to v.Given an array of integers (0 indexed), you have to perform two types of queries in the array.

2 i j - find the average value of the inte >>继续阅读

lightoj1174

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

1174 - Commandos

InputA group of commandos were assigned a critical task. They are to destroy an enemy head quarter. The enemy head quarter consists of several buildings and the buildings are connected by roads. The commandos must visit each buildi >>继续阅读

lightoj1164

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

1164 - Horrible Queries

0 x y v - you have to add v to all numbers in the range of x to y (inclusive), where x and y are two indexes of the array.World is getting more evil and it's getting tougher to get into the Evil League of Evil. Since the leg >>继续阅读

lightoj1140

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

1140 - How Many Zeroes?

InputJimmy writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes will he write down?

Input starts with an integer T (≤ 11000), denoting the number of test ca >>继续阅读

lightoj1131

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

1131 - Just Two Functions

Find fn % M and gn % M. (% stands for the modulo operation.)Let fn = a1 * fn-1 + b1 * fn-2 + c1 * gn-3 gn = a2 * gn-1 + b2 * gn-2 + c2 * fn-3

Input

Input starts with an integer T (≤ 50), denoting the number of test cas >>继续阅读

lightoj1129

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

1129 - Consistency Checker

123SETI is receiving some weird signals for the past few days. After converting them to our number system they found out that some numbers are repeating. Due to travelling millions of miles signal gets distorted. Now they >>继续阅读

lightoj1127

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

1127 - Funny Knapsack

InputGiven n integers and a knapsack of weight W, you have to count the number of combinations for which you can add the items in the knapsack without overflowing the weight.

Input starts with an integer T (≤ 100), denoting >>继续阅读

lightoj1116

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

1116 - Ekka Dokka

They want to divide the cake such that N * M = W, where W is the dashing factor set by them. Now you know their dashing factor, you have to find whether they can buy the desired cake or not.Ekka and his friend Dokka decided to buy >>继续阅读

lightoj1113

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

1113 - Discover the Web

BACK: If the backward stack is empty, the command is ignored. Otherwise, push the current page on the top of the forward stack. Pop the page from the top of the backward stack, making it the new current page.Standard web bro >>继续阅读

lightoj1112

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

1112 - Curious Robin Hood

Now each time he can he can do one of the three tasks.Robin Hood likes to loot rich people since he helps the poor people with this money. Instead of keeping all the money together he does another trick. He keeps n sacks w >>继续阅读

lightoj1088

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

1088 - Points in Segments

For example if the points are 1, 4, 6, 8, 10. And the segment is 0 to 5. Then there are 2 points that lie in the segment.Given n points (1 dimensional) and q segments, you have to find the number of points that lie in each >>继续阅读

lightoj1083

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

1083 - Histogram

Usually, histograms are used to represent discrete distributions, e.g., the frequencies of characters in texts. Note that the order of the rectangles, i.e., their heights, is important. Calculate the area of the largest rectangle i >>继续阅读

lightoj1080

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

1080 - Binary Simulation

'I i j'    which means invert the bit from i to j (inclusive)Given a binary number, we are about to do some operations on the number. Two types of operations can be here.

'Q i'    answer whether the ith bit is 0 or 1

Th >>继续阅读

lightoj1078

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

1078 - Integer Divisibility

For example you have to find a multiple of 3 which contains only 1's. Then the result is 3 because is 111 (3-digit) divisible by 3. Similarly if you are finding some multiple of 7 which contains only 3's then, the result >>继续阅读

lightoj1074

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

1074 - Extended Traffic

InputDhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destination, the city autho >>继续阅读

lightoj1070

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

1070 - Algebraic Problem

InputGiven the value of a+b and ab you will have to find the value of an+bna and b not necessarily have to be real numbers.

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

Each case contai >>继续阅读