Design and write code for automatic fighting games.

1) Role class CRole is the base class: Constructor, destructor; Member variables: avatar, HP (blood volume), ATK (attack), DEF (defense), Lv (rank), EXP (experience value); Member function: Weapon attack, jump. 2) Hero CHero inherits from CRole class Constructor, destructor; The new skills of heroes, kicking (member function), hugging (member f ...

Posted by schme16 on Fri, 24 Jan 2020 08:20:46 -0800

Cool liver competition

For this competition, I really rowed a little bit. I did two questions. When I did the third question, I didn't know where I was stuck. Then my family came to the guests and was taken out for dinner. ε = ('ο ')) alas!!! B - Just Eat It! This problem is a classic DP problem. I'm not very familiar with recursion. I have to find th ...

Posted by richo89 on Sat, 18 Jan 2020 10:01:36 -0800

Pocket sky

Background of topic Xiaoshan sits in the classroom and looks at the pocket like sky through the pocket like window. There are a lot of clouds floating there. They look very beautiful. Xiaoshan wants to pick some clouds that are so beautiful and make them into marshmallows. Title Description Give you the number of clouds N, and then give you ...

Posted by Xzone5 on Sat, 04 Jan 2020 19:22:11 -0800

[BZOJ2059] Buying Feed

Problem surface John drove to town. He wanted to take V tons of feed home. If he has x tons of feed in his car, it will cost X^2 yuan per kilometer, and D* X^2 yuan for driving D kilometer. John can buy feed from n stores, all of which are on the same axis. The location of the ith store is Xi. The price of feed is Ci yuan per ton, and the stoc ...

Posted by BrianM on Sat, 04 Jan 2020 08:01:30 -0800

2019 Netease game school recruitment - Test and Development Engineer programming question-C++

Written examination of 2019 Netease Internet school recruitment - programming questions 1. The old Tetris game machine. Title: customize the number of Tetris columns. The number of Tetris dropped each time is 1 * 1. When a row is full of Tetris, score + 1. Now Xiaoming plays m Tetris and gets the score at this time. Input: Number of columns in ...

Posted by hori76 on Thu, 02 Jan 2020 12:54:10 -0800

Simple application of c/c + + friend

Simple application of friend 1. Object + object, or object + number, can overload + function with class member function. However, number + object cannot overload + function with class member function, Because the compiler will translate the number + object into the number. operator+(const class & object), because the number is not an object ...

Posted by ssj4gogita4 on Thu, 02 Jan 2020 10:50:37 -0800

c/c + + template and STL small sample series template class and friend function

c/c + + template and STL small example series < 2 > template class and friend function For example, if a class is a template class D, there is a requirement to overload the operator < function of D, then a friend is needed. Three steps are necessary to achieve such a friend 1. Declare the friend function above the implementation code o ...

Posted by Plakhotnik on Thu, 02 Jan 2020 00:47:52 -0800

c/c + + template and STL small sample series self built Array

c/c + + template and STL small example series < 1 > self bui lt Array The self built Array provides the following external interfaces Method Function description Array() The nonparametric construction method constructs an array with the number of elements as template parameters Array(int length) There is a parameter construction me ...

Posted by gaogier on Wed, 01 Jan 2020 21:42:18 -0800

The problem of matching scheme of P2756 pilot in Luogu

Full name: linear programming and network flow 24 questions In order of difficulty: 1. Pilot pairing scheme problem (find the maximum number of matches and output the pairing scheme) There are two approaches: 1) the Hungarian algorithm of bipartite graph matching can directly find the maximum matching number, and the best matching scheme is rec ...

Posted by yuraupt on Wed, 01 Jan 2020 00:26:04 -0800

R1 A median of Niuke NOIP improvement group (dichotomy)

meaning of the title Title Link Sol It's a fairy's question. There will only be $n^2 $violence in the exam room.. Consider bisecting a $mid $directly, and let's see if the final answer is likely to be greater than $x $. When judging, just record the minimum prefix value, Let $s[i] $indicate how much of $1-i $is larger than it. The requi ...

Posted by bouwob on Tue, 31 Dec 2019 23:10:05 -0800