| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 1164 | Solve It |
|
| 1165 | Andy's First Dictionary |
|
| 1166 | Product |
|
| 1167 | Twin Primes |
|
Description
Category: Binary Search
Solve the equation:
p × e−x + q × sin(x) + r × cos(x) + s × tan(x) + t × x2 + u = 0
where 0 ≤ x ≤ 1.
Input
Input consists of multiple test cases and terminated by an EOF. Each test case consists of 6 integers in a single line: p, q, r, s, t and u (where 0 ≤ p, r ≤ 20 and −20 ≤ q, s, t ≤ 0). There will be maximum 2100 lines in the input file.
Output
For each set of input, there should be a line containing the value of x, correct up to 4 decimal places, or the string "No solution", whichever is applicable.
Remark
You may assume that there is no such case that all the coefficients are 0.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Category: Sorting
Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the words himself, he has a brilliant idea. From his bookshelf he would pick one of his favorite story books, from which he would copy out all the distinct words. By arranging the words in alphabetical order, he is done! Of course, it is a really time-consuming job, and this is where a computer program is helpful.
You are asked to write a program that lists all the different words in the input text. In this problem, a word is defined as a consecutive sequence of alphabets, in upper and/or lower case. Words with only one letter are also to be considered. Furthermore, your program must be CaSe InSeNsItIvE. For example, words like "Apple", "apple" or "APPLE" must be considered the same.
Input
The input file is a text with no more than 5000 lines. An input line has at most 200 characters. Input is terminated by EOF.
Output
Your output should give a list of different words that appears in the input text, one in a line. The words should all be in lower case, sorted in alphabetical order. You can be sure that the number of distinct words in the text does not exceed 5000.
Remark
The characters '!', '?', ';', '"'(double quotes ), '''(single quotes), ':', '.', and ',' are the only characters other than English alphabet, white spaces, and new line characters that may appear in the judge data prepared for this exam.
The number of total words in the text is less than 60000.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Category: Big Numbers
The problem is to multiply two integers X, Y. (0 ≤ X, Y < 10250)
Input
There are at most 500 testcases. The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.
Output
For each input pair of lines the output line should consist of one integer the product.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Category: Prime
Twin primes are pairs of primes of the form (p, p+2). The term "twin prime" was coined by Paul Stäckel (1892-1919). The first few twin primes are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43). In this problem you are asked to find out the S-th twin prime pair where S is an integer that will be given in the input.
Input
Each line of the input contains an integers S (1 ≤ S ≤ 105), which is the serial number of a twin prime pair. Input file is terminated by end of file.
Output
For each line of input you will have to produce one line of output which contains the S-th twin prime pair. The pair is printed in the form (p1,