1000 - Hello World
Time Limit1 second(s) Memory Limit32 MB
In this problem you don't have to do anything but print a line ``Hello World''. There is no input for this problem.
Input
Output
Sample Input
Sample Output
Hello World
1001 - Loop (Version 2)
Time Limit2 second(s) Memory Limit32 MB
Problem: Loop (version 2)
Problem Description
In this problem you are given an integer number n representing the number of lines in the output. The output will follow the following sequence:
1
22
333
4444
. . .
Input:
You are given an integer which represents the number of lines in the output.
Output:
There will be n lines in the output with above sequence.
Sample Input:
3
Sample Output:
1
22
333
1002 - Money in the bag
Time Limit2 second(s) Memory Limit32 MB
Problem: Money in the Bag
Problem Description
Determine how much money you have, where you have several notes of 1000 taka, 500 taka, 100 taka, 50 taka, 20 taka, 10 taka, 5 taka, 2 taka, 1 taka and 50 paisa.
Hint: As you are submitting the solution to online judge, you don't have to read and/or write anything other than the mentioned input/output. That is, you must not write any thing like this: "Enter the number:", "The result is"...etc. You have to follow exactly what is told in the input output section.
Input:
There will be only one test case. The test case contains 10 non negative integer numbers representing how many notes you have of each type in the order mentioned above. (That is, first number shows the number of notes of 1000 taka, and tenth number shows the number of coins of 50 paisa).
Output:
Print one line representing how much money (in taka) you have and print "taka" at the end of your result. Please see the sample output for more details. (As usual, after printing the result, you have to print a new line at the end).
Sample Input:
10 3 6 7 3 56 7 21 98 15
Sample Output:
13252.50 taka
*Hint: %.2lf is required to show 2 digits after decimal point.
1003 - Position of a letter
Time Limit2 second(s) Memory Limit32 MB
Problem: Position of a letter
Problem Description
In this problem you are given a lower case letter and you have to print ASCII value, upper case of that letter and the position of that letter (where 'a'=1 . . . z' = 26)
Hint: You can use getchar() or scanf() function to take a character as input. Try both of them to solve.
Input:
You are given only one character (lower case letter) as input.
Output:
First print the given input, then its corresponding ASCII value, after that its upper case version and then its position in alphabetical list. See the sample output.
Sample Input:
a
Sample Output:
a 97 A 1
1004 - Date Comparison
Time Limit2 second(s) Memory Limit32 MB
Problem: Date Comparison
Problem Description
In this problem you are given two dates and you have to determine the relationship between the two dates and print appropriate relational operators. For example if the first date is 22nd April, 2007 and second date is 1st may, 2007, your output should be <.
Input:
First line of the input is an integer t which denotes how many sets of inputs are there. Each of the next t lines contain two dates (in day/month/year format).
Output:
For each line of input produce one line of output. This line contains any one of the relational operators >, < or =, which indicates the relation that is appropriate for the given dates.
Sample Input:
3
22 4 2007 1 6 2007
1 3 2008 3 1 2007
12 12 2008 12 12 2008
Sample Output:
<
>
=
1005 - Date Formatting
Time Limit2 second(s) Memory Limit32 MB
Problem: Date Formatting
Problem Description
In this problem you are given a date and you have to print it in specific format. For example, if the given date is: 1-6-2009, the corresponding output will be 1st June,2009
Input:
First line of the input is an integer t which denotes how many sets of inputs are there. Each of the next t lines contains one date (in day-month-year format).
Output:
For each test case, print one line of output representing the date in specific format. See the sample output for more details:
Sample Input:
4
22 4 2007
31 1 2009
11 9 1999
3 5 2010
Sample Output:
22nd April,2007
31st January,2009
11th September,1999
3rd May,2010
1006 - Sum
Time Limit2 second(s) Memory Limit32 MB
Problem: Sum
In this problem you are given a set of numbers. For each number n you have to produce the sum from 1 to n. Input will be terminated by 0.
Sample Input:
5
10
100
0
Sample Output:
15
55
5050
1007 - Relational Operators
Time Limit2 second(s) Memory Limit32 MB
Relational Operators
Input: Standard Input
Input: Standard Input
Output: Standard Output
Some operators checks about the relationship between two values and these operators are called relational operators. Given two numerical values your job is just to find out the relationship between them that is (i) First one is greater than the second (ii) First one is less than the second or (iii) First and second one is equal.
Input
First line of the input file is an integer t (t<=200) which denotes how many sets of inputs are there. Each of the next t lines contain two integers a and b. Both a and b will be fit into 32 bit signed integer.
Output
For each line of input produce one line of output. This line contains any one of the relational operators ``>'', ``<'' or ``='', which indicates the relation that is appropriate for the given two numbers.
Sample Input Output for Sample Input
3 10 20 20 10 10 10 | < > = |
Adapted from Valladolid Online Judge (11172), with test data enhanced
1008 - A Palindromic Number (E)
Time Limit2 second(s) Memory Limit32 MB
A | 2009.06.04 - CSEDU Summer Warm up Contest 1 | Time Limit: 2 seconds |
A Palindromic Number |
A palindromic number or numeral palindrome is a 'symmetrical' number like 16461, that remains the same when its digits are reversed. In this problem you will be given an integer, you have to say whether the the number is a palindromic number or not.
Input
The first line of input will contain T which denotes the number of test cases. Each of the next T lines will contain a non-negative integer. No number in the input contains more than 9 digits.
Output
For each case of input, print the case number (starting from 1)and 'Yes' or 'No' depending on the input.
Sample Input | Output for Sample Input |
5 1 21 16161 523125 0 | Case 1: Yes Case 2: No Case 3: Yes Case 4: No Case 5: Yes |
Problem Setter: Jane Alam Jan
1009 - CSEDU Lift
Time Limit2 second(s) Memory Limit32 MB
C | 2009.06.04 - CSEDU Summer Warm up Contest 1 | Time Limit: 2 seconds |
CSEDU Lift |
All of you must have noticed that the lift of our department is again in action. And again students are becoming lazy to use the stairs. Now as a brilliant but lazy student you also don't use stairs. Its not a problem for you to wait, but you always use lift.
Now one day you were sleeping in the class and when you woke up you found none in the department except 'Shahid Vai' who was in a deep sleep in his room. But luckily you found the lift on. So, you want to go to the ground floor using the lift. But the lift can be in a different floor. Then you must wait for the lift to come to your floor. Assume that it takes 4 seconds for the lift to go from any floor to its adjacent floor (up or down). It takes 3 seconds to open or close the door of the lift and you need 5 seconds to enter or exit the lift. Given your position and the lift's position you have to calculate the time for you to reach the ground floor (floor 0). Reaching ground floor means you must get out of the lift in ground floor.
Input
The first line of input will contain T which denotes the number of test cases.
Each of the next T lines will contain two integers. The first integer means your position (different than 0) and the second integer means the position of the lift. Assume that our department has 100 floors (may be one day it will be :D).
Output
For each case of input, print the case number (starting from 1)and the calculated time in seconds.
Sample Input | Output for Sample Input |
2 1 2 3 10 5 5 | Case 1: 27 Case 2: 59 Case 3: 39 |
Explanation of case 1: You are in floor 1 and the lift is in floor 2. Now the required time is
- 4 seconds for the lift to come from floor 2 to floor 1
- 3 seconds to open the door
- 5 seconds to enter the lift
- 3 seconds to close the door
- 4 seconds to reach floor 0 (ground floor)
- 3 seconds to open the door
- 5 seconds to exit the lift
So, the overall time is 4+3+5+3+4+3+5 = 27 seconds.
Problem Setter: Jane Alam Jan
1010 - Easy Pythagoras
Time Limit2 second(s) Memory Limit32 MB
E | 2009.06.04 - CSEDU Summer Warm up Contest 1 | Time Limit: 2 seconds |
Easy Pythagoras |
I think all of you know who is Pythagoras. Yes, I am talking about the mathematician from our geometry book (class 9). His famous theorem was
In any right triangle, the area of the square whose side is the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares whose sides are the two legs (the two sides that meet at a right angle).
The theorem can be written as an equation:
The theorem can be written as an equation:
a2 + b2 = c2
Now you have to find all the solutions of this equation where a, b and c all are integers, ( 1 <= a, b, c <= 100 ) and (a <= b).
Input
This problem has no input.
Output
For each case of input, print the line number (starting from 1)and the solutions. Print the solutions in lexicographical order (based on a, b and c).
Sample Output |
Line 1: 3 4 5 Line 2: 5 12 13 Line 3: 6 8 10 ... Line 50: 60 63 87 Line 51: 60 80 100 Line 52: 65 72 97 |
Problem Setter: Jane Alam Jan
1011 - Fast and Easy
Time Limit2 second(s) Memory Limit32 MB
F | 2009.06.04 - CSEDU Summer Warm up Contest 1 | Time Limit: 2 seconds |
Fast and Easy |
Given three integers, you have to print them in ascending order.
Input
The first line of input will contain T which denotes the number of test cases. Each of the next T lines will contain three integers.
Output
For each case of input, print the case number (starting from 1)and the integers in ascending order.
Sample Input | Output for Sample Input |
5 1 2 3 3 2 1 2 1 3 -1 -2 -3 -2 3 -1 | Case 1: 1 2 3 Case 2: 1 2 3 Case 3: 1 2 3 Case 4: -3 -2 -1 Case 5: -2 -1 3 |
Problem Setter: Jane Alam Jan
1012 - Expressions
Time Limit2 second(s) Memory Limit32 MB
Given an arithmetic expression you have to find that whether the expression is valid or not. The expression is in the form 'a+b=c'. But the machine you are using evaluates everything form right to left.
Input
The first line of input will contain T which denotes the number of test cases. Then there will be T cases.
Each case will contain an expression. And a, b, c will not contain more than 9 digits.
Each case will contain an expression. And a, b, c will not contain more than 9 digits.
Output
For each case of input, print the case number (starting from 1)and 'True' or 'False' depending on the expression.
Sample Input
8
73+42=16
5+8=13
10+20=30
0001000+000200=00030
1234+5=1239
1+0=0
7000+8000=51
0+0=0
73+42=16
5+8=13
10+20=30
0001000+000200=00030
1234+5=1239
1+0=0
7000+8000=51
0+0=0
Sample Output
Case 1: True
Case 2: False
Case 3: True
Case 4: True
Case 5: False
Case 6: False
Case 7: True
Case 8: True
Problem Setter : Jane Alam Jan
1013 - An Encoding Scheme
Time Limit2 second(s) Memory Limit32 MB
There are many encoding schemes for sending messages as well as message compression. One of the common encoding scheme is the Run Length Encoding scheme. The idea is described below.
Given a string, you will count a digit then print the digit and its corresponding frequency. May be it sounds a bit harder. Some examples will make things clear. Suppose the given string is 11222344444, now see that there are 2 ones, 3 twos, 1 three and 5 fours. So, the result should be 12233145. So, the result for 991222 is 921123.
In this problem you are given a string containing digits only. You have to print the Run Length Encoding for the string.
Input
The first line of the input gives you the number of test cases, T. Then T test cases follow.
Each case starts with a string containing no more than 1000 characters. So, if you are using an array for taking input be sure that it has at least 1001 characters.
Output
For each case, first print the case number (staring from 1), then print the result.
Sample Input
3 11222344444 991222 2111111111
Sample Output
Case 1: 12233145 Case 2: 921123 Case 3: 2119
1014 - Bad Printer
Time Limit2 second(s) Memory Limit32 MB
My printer is not working. Its not just working but also showing some abnormal behavior. It takes two integers as a command (start page and end page) but instead of printing the pages it starts to print all the integers between a and b (a and b are the inputs). Now I am wondering about the behavior of my printer. Your task is to write a software which will show the outcome of my printer.
Input
The first line of input will contain T which denotes the number of test cases.
Each case contains two integers a and b.
Output
For each case of input print the case number (starting from 1)in a single line. The next line should contain the outcome of my printer. Integers should be separated by dots '.'. Check the samples for more details.
Sample Input
3 2 5 0 9 100 110
Sample Output
Case 1: 2.3.4.5 Case 2: 0.1.2.3.4.5.6.7.8.9 Case 3: 100.101.102.103.104.105.106.107.108.109.110
1015 - Chris Gayle
Time Limit2 second(s) Memory Limit32 MB
I am a big fan of Chris Gayle, the west Indian Captain. Though he hasn't scored too many runs today (Bravo drove West Indies to victory :D). However some notes are noted below
Christopher "Chris" Henry Gayle (born 21 September, 1979 in Kingston , Jamaica ) is a West Indian cricketer who is captain for the West Indies cricket team and plays domestic cricket for Jamaica . He is a hard-hitting left-handed opening batsman with a wide-range of shots, who can also bowl right-arm off spin when called upon. Gayle is a successful One Day International player, with nearly 200 appearances for his country and 19 centuries. He is also a successful Test batsman, averaging just under 40.00, with a landmark 317 against South Africa . As a prominent one day player, Gayle was chosen by the Kolkata Knight Riders in the Indian Premier League - playing in the second competition in early 2009.
In this problem you will be given a string containing per ball score by Chris Gayle.
Input
The first line of the input gives you the number of test cases, T. Then T test cases follow.
Each case contains a string containing Chris Gayle's per ball score. The string will not contain more than 100 characters.
Output
For each case you have to print the match number (starting from 1) and the scores in the following fashion.
Sample Input
3 .31.2.6.4.6 6466112 1....11..........2
Sample Output
Match 1:
Sixes 2
Fours 1
Threes 1
Twos 1
Ones 1
Dots 5
Total runs scored 22
Match 2:
Sixes 3
Fours 1
Threes 0
Twos 1
Ones 2
Dots 0
Total runs scored 26
Match 3:
Sixes 0
Fours 0
Threes 0
Twos 1
Ones 3
Dots 14
Total runs scored 5
Sixes 2
Fours 1
Threes 1
Twos 1
Ones 1
Dots 5
Total runs scored 22
Match 2:
Sixes 3
Fours 1
Threes 0
Twos 1
Ones 2
Dots 0
Total runs scored 26
Match 3:
Sixes 0
Fours 0
Threes 0
Twos 1
Ones 3
Dots 14
Total runs scored 5
1016 - D3
Time Limit10 second(s) Memory Limit32 MB
You have to find all a, b, c and d for which
a3 + b3 + c3 = d3
( 1 <= a, b, c, d <= 100 and a <= b <= c )
Input
There is no input.
Output
For each line print the line number starting from 1, and the a, b, c, and d in lexicographical order based on a, b, c and d.
Sample Input
Sample Output
Line 1: 1 6 8 9
Line 2: 2 12 16 18
Line 3: 2 17 40 41
...
Line 81: 54 60 74 92
...
Line 2: 2 12 16 18
Line 3: 2 17 40 41
...
Line 81: 54 60 74 92
...
1017 - Loop (Version 3)
Time Limit2 second(s) Memory Limit32 MB
In this problem you are given an integer number n representing the number of lines in the output. The output will follow the following sequence:
1
23
456
78910
. . .
Input
You are given an integer which represents the number of lines in the output.
Output
There will be n lines in the output with above sequence.
Sample Input
3
Sample Output
1
23
456
23
456
1018 - Loop (Version 4)
Time Limit2 second(s) Memory Limit32 MB
In this problem you are given an integer number n representing the number of lines in the output. The output will follow the following sequence:
1
121
12321
1234321
. . .
Input
You are given an integer which represents the number of lines in the output.
Output
There will be n lines in the output with above sequence.
Sample Input
3
Sample Output
1
121
12321
121
12321
1019 - Loop (Version 5)
Time Limit2 second(s) Memory Limit32 MB
In this problem you are given an integer number n representing the number of lines in the output. The output will follow the following sequence:
1
232
34543
4567654
567898765
67890109876
7890123210987
. . . . . . .
. . . . . . .
According to the sequence, after 9, zero (0) will come instead of 10.
1
232
34543
4567654
567898765
67890109876
7890123210987
. . . . . . .
. . . . . . .
According to the sequence, after 9, zero (0) will come instead of 10.
Input
You are given an integer n which represents the number of lines in the output.
Output
There will be n lines in the output with above sequence. Note that, there may exists some space before sequence but there must not any space after the sequence
Sample Input
3
Sample Output
1
232
34543
232
34543
1020 - Digit Sum
Time Limit2 second(s) Memory Limit32 MB
In this problem you have to calculate the number of digits in a given number, reverse of this number and the summation of the given number and its reverse number.
Input
First line of the input is an integer t which denotes how many sets of inputs are there. Each of the next t lines contains one non negative integer number. Be careful, zero (0) can be given as input in the program. You can safely assume that there will be no leading zeros in the given number (that is, 0001 is not given as input)
Output
For each test case there will be one line of output. Print the given number first, then the number of digits in that number, after that the reverse of that number and at the end the summation of the given number and its reverse number.
Sample Input
4
1
1234
0
100
1
1234
0
100
Sample Output
1 1 1 2
1234 4 4321 5555
0 1 0 0
100 3 1 101
1234 4 4321 5555
0 1 0 0
100 3 1 101
1021 - Are They Same?
Time Limit2 second(s) Memory Limit32 MB
How can we determine if two sentences are exactly same? A sentence is a finite sequence of words delimited by spaces. Two sentences will be exactly same if and only if the words of the sentences are exactly same and also in the same order. A word is defined as a consecutive sequence of alphabets. And of course the comparison should be case sensitive. That means 'This' and 'tHiS' are not same.
Input
The first line of the input will consist of a number N. Then N pairs of sentences follow. There will be one sentence in one line. The sentences will consist of only alphabets and spaces. Each sentence will contain maximum 30 words and each word will have a maximum length of 20. Each word will be separated by one or more spaces. A sentence will contain no more than 1000 characters.
Output
For each case of input print the case number (starting from 1)and 'Sentences are same.' if the sentences are same, 'Sentences are different.' otherwise.
Sample Input
4 This is same This is same This is same not This is not same Again and again Again and Again This problem is easy This problem is easy
Sample Output
Case 1: Sentences are same. Case 2: Sentences are different. Case 3: Sentences are different. Case 4: Sentences are same.
Problem Setter : Hasnain Heickal
Special Thanks to : Sabbir Ahmed (Description Formatting)
1022 - Impossible HHH
Time Limit2 second(s) Memory Limit32 MB
I love wrestling and my favorite wrestler is HHH. And yes, as you know that he is a tough wrestler, and this is a problem about him so, the problem is actually one of the hardest problems.
However, in this problem you have to find the statistics of HHH. You will be given the result of some matches played by HHH and you have to calculate the statistics of the overall result. The result of the matches is one of
win
lose
draw
And you have count the total number of wins, draws and loses.
lose
draw
And you have count the total number of wins, draws and loses.
Input
The first line of input will contain T which denotes the number of test cases.
The first line of each set contains an integer n (1 <= n <= 100). Then there will be n lines saying 'win' or 'draw' or 'lose'.
Output
For each case first print the case number starting from 1. Then print three lines which contain the statistics. See the sample input-output for more details.
Sample Input
3
2
draw
lose
1
draw
5
win
win
lose
draw
draw
2
draw
lose
1
draw
5
win
win
lose
draw
draw
Sample Output
Case 1: win 0 lose 1 draw 1 Case 2: win 0 lose 0 draw 1 Case 3: win 2 lose 1 draw 2
Problem Setter : Jane Alam Jan
1023 - Robin Hood Plays Football
Time Limit1 second(s) Memory Limit32 MB
We all have heard the name ''Robin Hood''. Once he was asked to participate in a football match. As usual, he had to join the practice session before the game. But, we know, he was not at all a ''Footballer''. So he decided to do something related to Archery. He took two balls of same size, and kept them touching together. Then he started to aim his Arrow (not his leg!) at the point at which the balls are touching together. He didn't know Mathematics, especially Geometry. So, if you like him, here's the chance for you to help him! Tell him the point where to aim!!
The job is simple. You will be given the co-ordinates of the Centers of the footballs and the radius. Determine the point at which the balls are touching together. You can assume that the footballs can be considered as circles and they are in same size.
Input
The first line of input will contain T which denotes the number of test cases. Each will contain five real numbers (x1, y1, x2, y2) where x1, y1 and x2, y2 are the co-ordinates of the two centers of the circles
Output
For each case first print the case number starting from 1. Then print the co-ordinates of the aiming point with two digits after the decimal point. The X & Y co-ordinates will be separated by spaces.
Sample Input
3 12.0 6.5 8.2 9.9 5.4 2.3 5.6 2.9 45.12 56.23 78.21 29.25
Sample Output
Case 1: 10.10 8.20
Case 2: 5.50 2.60
Case 3: 61.67 42.74
Problem Setter : Ashraf - Uz - Zaman
Special Thanks to : Sabbir Ahmed (Description Formatting)
1024 - Simple Encoder
Time Limit2 second(s) Memory Limit32 MB
Now a days data encryption is a very popular method for protecting data from unauthorized users. In professional software data encryption is done under lots of complex rules. But now you have to make a simple encoder which maintains the following rules:1. First vowel will change into last vowel, 2nd into the 2nd-last. i.e.
A | U |
E | O |
I | I |
O | E |
U | A |
2. Same rules for the consonant. Exp-
B | Z |
C | Y |
... | ... |
Y | C |
Z | B |
3. For digits:-
0 | 9 |
1 | 8 |
... | ... |
8 | 1 |
9 | 0 |
4. Encoding is case sensitive. That means 'A' is replaced by 'U' and 'a' is replaced by 'u'.
5. All the other characters should remain same after encoding.
Input
The first line of input will contain T which denotes the number of test cases.
Each case of input consists of a string of at most 100 characters. This is the string which has to be encoded.
Each case of input consists of a string of at most 100 characters. This is the string which has to be encoded.
Output
For each case first print the case number starting from 1. Then print the encoded string.
Sample Input
3 My name is ... I m in CSEDU, 14th batch. Thank u. Hope this help.
Sample Output
Case 1: Pc nupo ij ... Case 2: I p in YJOXA, 85ht zuhyt. Case 3: Htunr a. Temo htij toqm.
Problem Setter : Shariful Islam (Tulip)
Special Thanks to : Sabbir Ahmed (Description Formatting)
1025 - Inverting Probability
Time Limit2 second(s) Memory Limit32 MB
Sometimes some mathematical problems require probabilities. In this problem you are given the probability of an event to be happened. You have to calculate the inverse, that means the probability that the event will not occur.
Input
The first line of the input gives you the number of test cases, T. Then T test cases follow.
Each case contains a real number meaning the probability.
Output
For each of the test cases, you have to print the case number and the desired result rounded to 3 fractional digits.
Sample Input
2
0.25
0.5
0.25
0.5
Sample Output
Case 1: 0.750
Case 2: 0.500
Case 2: 0.500
Note
The Judge file is created such that epsilon will not make any harm.
Problem Setter : Jane Alam Jan
1026 - Backtrack
Time Limit2 second(s) Memory Limit32 MB
Backtracking means tracking backwards. Now we are given an integer. You have to backtrack, that means you have to print the integer if you backtrack the original integer!
Input
The first line of the input gives you the number of test cases, T. Then T test cases follow.
Each case will contain an integer n (0 <= n <= 100 000 000).
Output
For each line of input you have to print a line containing the case number and the integer found by backtrack of the original integer.
Sample Input
5
5
0
1001
123
98799
Sample Output
Case 1: 5
Case 2: 0
Case 3: 1001
Case 4: 321
Case 5: 99789
Problem Setter : Jane Alam Jan
No comments:
Post a Comment