oftest

HDU 6685 Rikka with Coin (枚举 思维)

℡╲_俬逩灬. 提交于 2020-04-30 04:20:38
2019 杭电多校 9 1006 题目链接: HDU 6685 比赛链接: 2019 Multi-University Training Contest 9 Problem Description Rikka hates coins, and she used to never carry any coins with her. These days, Rikka is doing her summer internship abroad. Without mobile payment, Rikka has to face strange prices of commodities, and as a result of always using paper currency, she has to face mountainous coins on here table. In the local currency system, there are $4$ kinds of coins: $10$ cents, $20$ cents, $50$ cents and $1$ dollar. Up to now, Rikka has gained at least $10^{100}$ coins for each kind. Now, Rikka is going to have

HDU 6693 Valentine's Day (概率)

荒凉一梦 提交于 2020-04-30 04:20:26
2019 杭电多校 10 1003 题目链接: HDU 6693 比赛链接: 2019 Multi-University Training Contest 10 Problem Description Oipotato loves his girlfriend very much. Since Valentine's Day is coming, he decides to buy some presents for her. There are $n$ presents in the shop, and Oipotato can choose to buy some of them. We know that his girlfriend will possibly feel extremely happy if she receives a present. Therefore, if Oipotato gives $k$ presents to his girlfriend, she has $k$ chances to feel extremely happy. However, Oipotato doesn't want his girlfriend to feel extremely happy too many times for the gifts.

The Battle of Chibi(数据结构优化dp,树状数组)

混江龙づ霸主 提交于 2020-04-28 12:00:56
The Battle of Chibi Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is to have a spy in Cao Cao’s army. But all generals and soldiers of Cao Cao were loyal, it’s impossible to convince any of them to betray Cao Cao. So there is only one way left for Yu Zhou, send someone to fake surrender Cao Cao. Gai Huang was selected for this important mission. However, Cao Cao was not easy to believe others, so Gai Huang must leak some important information to Cao Cao before surrendering. Yu Zhou discussed with

Dice (III) (数学期望)

守給你的承諾、 提交于 2020-04-26 05:33:08
Dice (III) LightOJ - 1248 Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, that means when you throw the dice, the probability of occurring any face is equal. For example, for a fair two sided coin, the result is 3. Because when you first throw the coin, you will definitely see a new face. If you throw the coin again, the chance of getting the opposite side is 0.5, and the chance of getting the same side is 0.5. So, the result is 1 + (1 + 0.5 * (1 + 0.5 * ...)) = 2 + 0.5 + 0.5

Codeforces Round #633 (Div. 2)

时光怂恿深爱的人放手 提交于 2020-04-20 07:21:27
You have integer n n. Calculate how many ways are there to fully cover belt-like area of 4 n − 2 4n−2 triangles with diamond shapes. Diamond shape consists of two triangles. You can move, rotate or flip the shape, but you cannot scale it. 2 2 coverings are different if some 2 2 triangles are covered by the same diamond shape in one of them and by different diamond shapes in the other one. Please look at pictures below for better understanding. On the left you can see the diamond shape you will use, and on the right you can see the area you want to fill. These are the figures of the area you

UVA11876 N + NOD (N)【欧拉筛法+前缀和】

自闭症网瘾萝莉.ら 提交于 2020-04-20 05:22:47
Consider an integer sequence N where, N0 = 1 Ni = Ni−1 + NOD(Ni−1) for i > 0 Here, NOD(x) = number of divisors of x. So the first few terms of this sequence are 1 2 4 7 9 12 18 … Given two integers A and B, find out the number of integers in the above sequence that lies within the range [A, B]. Input The first line of input is an integer T (T < 100000), that indicates the number of test cases. Each case contains two integers, A followed by B (1 ≤ A ≤ B ≤ 1000000). Output For each case, output the case number first followed by the required result. Sample Input 3 1 18 1 100 3000 4000 Sample

UVA1566 LA3830 POJ3480 HDU1907 John【博弈】

淺唱寂寞╮ 提交于 2020-04-17 14:18:32
【推荐阅读】微服务还能火多久?>>> John Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3727 Accepted: 1863 Description Little John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color. Then his opponent has to make a turn. And so on. Please note that each player has to eat at least one M&M during his turn. If John (or his brother) will eat the last M&M from the box he will be considered as a looser and he will have to buy a new candy box. Both of players are using optimal game

UVA11456 Trainsorting【LIS+DP】

拜拜、爱过 提交于 2020-04-06 18:03:58
Erin is an engineer. She drives trains. She also arranges the cars within each train. She prefers to put the cars in decreasing order of weight, with the heaviest car at the front of the train. Unfortunately, sorting train cars is not easy. One cannot simply pick up a car and place it somewhere else. It is impractical to insert a car within an existing train. A car may only be added to the beginning and end of the train. Cars arrive at the train station in a predetermined order. When each car arrives, Erin can add it to the beginning or end of her train, or refuse to add it at all. The