2198 - I2P(II)2020_Chen_week12_HW Scoreboard

Time

2020/12/01 23:59:00 2020/12/08 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12469 Big enough
12540 A lot of sandwiches
12543 Endgame

12469 - Big enough   

Description

"AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!"

~by anonymous singer

This problem is partial judge.

You need to deal with something "big enough".

Each input will contain two big integer a, b which are up to 5000 digits.

You need to calculate a+b and a-b.

The input will end by EOF.

 

 

 

Input

a and b is both up to 5000 digits and separated by a blank

The input will end by EOF

Output

For each input print the result of a+b and a-b.

Each result is end by a \n

Sample Input  Download

Sample Output  Download

Partial Judge Code

12469.cpp

Partial Judge Header

12469.h

Tags




Discuss




12540 - A lot of sandwiches   

Description

Gordon Ramsay: What are you ?

A poor chef: An idiot sandwich.


You are Gordon Ramsay's chief advisor. He's going to judge a lot of sandwiches whether it is an idiot sandwich or not. However, recording the result is too tired for him, so he yells at you for help.


You are given n​ sandwiches. Gordon will tell you the label of each sandwich in the following formats:

  • Ramsay <lvl>: All sandwiches followed with this format are idiot sandwiches. And the number lvl is the level of the intelligence of the corresponding idiot sandwich.

  • <name>: All sandwiches with name not equals to "Ramsay" are masterpiece(in Gordon's opinion, it's a normal sandwich), and name is its name.

And you're asked to record each sandwich with the following formats:

  • For idiot sandwiches, record An idiot sandwich with intelligence level <lvl> only., where lvl is the intelligence level of the sandwich.

  • For normal sandwiches, record <name>. Masterpiece of sandwiches., where name is the name of the sandwich.

Note that this problem is special judge, you have to implement the functions that marked with TODO in function.h.

Do remember to submit your code with language C++11 or higher! Otherwise you will get Compile Error!

Input

The first line contains exactly one integer, indicates .

There are lines below. Each line contains one of the sandwich format.

.

for all level of idiot sandwiches.

for all names of normal sandwiches. All letters are 'a' - 'z' or 'A' - 'Z' without any space or newline.

Output

For each sandwich, output its record.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12540.cpp

Partial Judge Header

12540.h

Tags




Discuss




12543 - Endgame   

Description

episode 1: http://140.114.86.238/problem/12254/

episode 2: http://140.114.86.238/problem/12436/

episode 3: http://140.114.86.238/problem/12522/


After Iron Man grab all the infinity stones from Thanos and set them onto his hand, he now has the ability to decide the destiny of the whole universe...

After snapping, Iron Man's mind is teleported into the deepest layer of the stones. He knows who he have to eliminate, that is, the Thanos army.

Iron Man & Thanos thinking about this problem.

If you click Iron Man, something might happen...


Iron Man's mind is now located in a 2-dimension flat with lives of all creatures. He can eliminate any creature by stepping on it. Most lives are innocent creatures, and Iron Man doesn't want to eliminate them. Those lives he wants to eliminate is only the Thanos army.

As he is now in a spiritual form, he can split himself, search, and eliminate Thanos army in every direction at the same time. He can only walk up, down, left, and right. Diagonal movement such as up-left or down-right is not allowed.

Iron Man wants to know the minimum distance he have to walk in order to eliminate all the Thanos army.


You are given a flat.

Every position may be in the following state:

  • .: There's nothing here, you can pass this place without worrying.
  • I: Here is the initial position you're at. There will be exactly one I on the flat.
  • T: The Thanos army are represented as a T. You have to eliminate all T on the flat. To eliminate them, you have to step onto every place with state T at least once.
  • C: All other innocent creatures. You cannot pass by or walk on this place since Iron Man don't want to eliminate innocents.

You're going to find out the minimum furthest distance that you need to walk.

Take sample as an example, the distance is marked below, and those red places is the place where you have to go through.

323C9
C1C98
C0CC7
212C6
CC345

 

Input

The first line contains two integers and .

There are lines below. Each line contains characters, indicate the state of all positions of the flat initially.

.

Output

Output the minimum distance that Iron Man have to walk in order to eliminate all the Thanos army. If it's impossible, output -1.

Sample Input  Download

Sample Output  Download

Tags




Discuss