2012-10-20 Noip Demo Game

Source: Internet
Author: User
Tags first row time limit

2012-10-20 Noip Demo Game

by COOLYANGZC

A total of 3 questions, time 3 hours

Topic name

Advanced Typewriter

Unequal series

Management and development

source file

Type.cpp/c/pas

Num.cpp/c/pas

Exploit.cpp/c/pas

Input file

Type.in

Num.in

Exploit.in

Output file

Type.out

Num.out

Exploit.out

Time limit

1000MS

1000MS

1000MS

Memory limit

256MB

256MB

256MB

Test point

5+ (5)

10

10

Test point Score

20

10

10

Evaluation environment

Operating system: Windows XP SP3

Cpu:pentium (R) dual-core CPU E5300 @ 2.60Ghz (2CPUs)

System memory: 2GB

Problem 1 Advanced Typewriter (TYPE.CPP/C/PAS)

"Title description"

Early seedling started with the newest advanced typewriter. The latest version of nature has a different function than before, that is, it has a revocation function, bad bar.

Please design a program for this kind of advanced typewriter, support the following 3 kinds of operation:

1.T x: Lay a lowercase letter x at the end of the article. (Type action)

2.U x: Undo the last X modification operation. (Undo action)

(Note that the query operation does not count as a modification operation)

3.Q x: asks for the X-Letter of the current article and outputs it. (Query operation)

The article can be considered an empty string at the beginning.

"Input Format"

Line 1th: An integer n that represents the number of operations.

The following n lines, one command per line. Ensure that the entered command is valid.

"Output Format"

Each line outputs a letter that represents the answer to the query operation.

"Sample Input"

7

T A

T b

T C

Q 2

U 2

T C

Q 2

"Sample Output"

B

C

"Data Range"

For 40% of data n<=200;

For data n<=100000; 100%, the undo operation is not undone.

< advanced challenges >

The undo operation can be undone for a 200% data n<=100000;undo operation.

<ioi Challenge >

The problem must be completed using an online algorithm.

Problem 2 Unequal series (Num.cpp/c/pas)

"Title description"

Arranges 1 to n arbitrarily, and then inserts ">" and "<" according to their size relationship between each of the two numbers arranged. Q in all permutations, how many permutations happen to have K "<". Answer to 2012 modulo.

"Input Format"

The first row of 2 integers n,k.

An integer that represents the answer.

"Sample Input"

5 2

"Sample Output"

66

"Data Range"

For 30% data: N <= 10

For 100% data: K < n <= 1000,

Problem 3 Management and development (EXPLOIT.CPP/C/PAS)

"Title description"

4X concept system refers to a fairly popular and mature system concept in PC strategy games, named after 4 English words that also begin with "EX".

EXplore (Explore)

EXpand (Extension and development)

EXploit (Management and development)

Exterminate (Conquest)

--Wikipedia

This time we are focusing on the exploit section and simplifying its model:

You drive a spaceship with a bit (initial capability value W) and fly over n planets in sequence according to a given route.

The planet is broadly divided into 2 categories: resource-based and maintenance-oriented. (P is the current capability value of the drill bit)

1. Resource type: Mineral quality a[i], if the choice of mining, then get a[i]*p money, then bit loss k%, that is p=p* (1-0.01k)

2. Maintenance Type: Maintenance cost b[i], if the choice of maintenance, then pay b[i]*p money, after the bit repair c%, that is p=p* (1+0.01c)

Note: The ability value of the drill bit after repair can exceed the initial value (you can think of a renovation + upgrade)

Please make a careful decision as captain to maximize your income.

"Input Format"

The first row of 4 integers n,k,c,w.

The following n lines, 2 integers per line, type,x.

Type 1 is a resource-based planet, X is its mineral content a[i];

Type 2 means it is a maintenance planet, X for its maintenance costs b[i];

"Output Format"

A real number (reserved for 2 decimal places) that represents the maximum income.

"Sample Input"

5 50 50 10

1 10

1 20

2 10

2 20

1 30

"Sample Output"

375.00

"Data Range"

For 30% of data n<=100

There is another 20% of the data n<=1000;k=100

For 100% of data n<=100000; 0<=k,c,w,a[i],b[i]<=100; guarantee that the answer is no more than 10^9

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.