487 - 營隊比賽 (2013/08/08) ICPC 2007 Dhaka Scoreboard

Time

2013/08/08 13:10:00 2013/08/08 18:10:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

1017 - Wavio Sequence   

Description

Wavio is a sequence of integers. It has some interesting properties.
· Wavio is of odd length i.e. L = 2*n + 1.
· The first (n+1) integers of Wavio sequence makes a strictly increasing sequence.
· The last (n+1) integers of Wavio sequence makes a strictly decreasing sequence.
· No two adjacent integers are same in a Wavio sequence.
For example 1, 2, 3, 4, 5, 4, 3, 2, 0 is an Wavio sequence of length 9. But 1, 2, 3, 4, 5, 4, 3, 2, 2 is not a valid wavio sequence. In this problem, you will be given a sequence of integers. You have to find out the length of the longest Wavio sequence which is a subsequence of the given sequence. Consider, the given sequence as :

1 2 3 2 1 2 3 4 3 2 1 5 4 1 2 3 2 2 1.

Here the longest Wavio sequence is : 1 2 3 4 5 4 3 2 1. So, the output will be 9.

Input

The input file contains less than 75 test cases. The description of each test case is given below: Input is terminated by end of file.

Each set starts with a postive integer, N(1<=N<=10000). In next few lines there will be N integers.

Output

For each set of input print the length of longest wavio sequence in a line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




3136 - Prime Path   

Description

 http://poj.org/problem?id=3126

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3137 - The House Of Santa Claus   

3138 - Following Orders   

Description

 http://poj.org/problem?id=1270

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3139 - Rails   

Description

 http://poj.org/problem?id=1363

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3140 - A Stack or A Queue?   

Description

 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3210

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3141 - Boolean Expressions   

Description

 http://poj.org/problem?id=2106

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3147 - Power Network   

Description

 http://poj.org/problem?id=1459

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3148 - Red and Black   

Description

 http://poj.org/problem?id=1979

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3149 - Conference   

Description

這題無法在 NTHU OJ 上面 submit,請大家到原本的 OJ 上送 code

 http://acm.timus.ru/problem.aspx?space=1&num=1109

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3150 - 小孩報數問題   

Description

 http://poj.org/problem?id=3750

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3188 - Longest Match   

3189 - History Grading   

3297 - Anniversary party   

Description

 http://poj.org/problem?id=2342

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3298 - Nuts for nuts..   

3299 - Lazy Cows   

Description

 http://poj.org/problem?id=2430

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




3300 - (*) Bachelor Arithmetic   

3301 - (*) Nested Squares   

3302 - (*) The Dumb Grocer   

3303 - (*) ACM Puzzles   

3304 - (*) Inspector's Dilemma   

3305 - (*) The Bells are Ringing   

3306 - (*) Photographic Tour   

3307 - (*) You are around me ...   

3308 - (*) Infinite Matrix   

3309 - (*) Magnetic Train Tracks   

7330 - Dollars   

Description

New Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may be made up. Changing the order of listing does not increase the count. Thus 20c may be made up in 4 ways: 1 x 20c, 2 x 10c, 10c+2 x 5c, and 4 x 5c.

Input

Input will consist of a series of real numbers no greater than $300.00 each on a separate line. Each amount will be valid, that is will be a multiple of 5c. The file will be terminated by a line containing zero (0.00).

Output

Output will consist of a line for each of the amounts in the input, each line consisting of the amount of money (with two decimal places and right justified in a field of width 6), followed by the number of ways in which that amount may be made up, right justified in a field of width 17.

Sample Input  Download

Sample Output  Download

Tags




Discuss




7428 - Tree Recovery   

Description

Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.
This is an example of one of her creations:

To record her trees for future generations, she wrote down two strings for each tree: a preorder traversal (root, left subtree, right subtree) and an inorder traversal (left subtree, root, right subtree). For the tree drawn above the preorder traversal is DBACEGF and the inorder traversal is ABCDEFG.
She thought that such a pair of strings would give enough information to reconstruct the tree later (but she never tried it).

Now, years later, looking again at the strings, she realized that reconstructing the trees was indeed possible, but only because she never had used the same letter twice in the same tree.
However, doing the reconstruction by hand, soon turned out to be tedious.
So now she asks you to write a program that does the job for her!

 

Input

The input file will contain one or more test cases.
Each test case consists of one line containing two strings preord and inord, representing the preorder traversal and inorder traversal of a binary tree. Both strings consist of unique capital letters. (Thus they are not longer than 26 characters.)
Input is terminated by end of file.

 

Output

For each test case, recover Valentine's binary tree and print one line containing the tree's postorder traversal (left subtree, right subtree, root).

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




7447 - Mondriaan's Dream   

Description

Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw on, for all of his paper was filled with squares and rectangles), he dreamt of filling a large rectangle with small rectangles of width 2 and height 1 in varying ways.
 
Expert as he was in this material, he saw at a glance that he'll need a computer to calculate the number of ways to fill the large rectangle whose dimensions were integer values, as well. Help him, so that his dream won't turn into a nightmare!

 

Input

The input file contains several test cases. Each test case is made up of two integer numbers: the height h and the width w of the large rectangle. Input is terminated by h = w = 0. Otherwise, 1 ≤ h, w ≤ 11.

Output

For each test case, output the number of different ways the given rectangle can be filled with small rectangles of size 2 times 1. Assume the given large rectangle is oriented, i.e. count symmetrical tilings multiple times.

Sample Input  Download

Sample Output  Download

Tags




Discuss