So you want to be a 2n-aire? PDF 在一个电视娱乐节目中,你一开始有1元钱.主持人会问你n个问题,每次你听到问题后有两个选择:一是放弃回答该问题,退出游戏,拿走奖金:二是回答问题.如果回答正确,奖金加倍:如果回答错误,游戏结束,你一分钱也拿不到.如果正确地回答完所有n个问题,你将拿走所有的\(2^n\)元钱,成为\(2^n\)元富翁.当然,回答问题是有风险的.每次听到问题后,你可以立刻估计出答对的概率.由于主持人会随机问问题,你可以认为每个问题的答对概率在t和1之间…
今天做题运气出奇的好,除了几处小错误调试之后忘记改掉了……最后还AK了……虽然题目不难,学长也说是福利局,但是对个人的鼓励作用还是挺大的……至此暑假训练就结束了,也算没有遗憾……. 题解如下: Problem A: 苦逼的MCA Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: %lld Java class name: Main Description 在TUBN这个地方,有个苦逼的人…
Contest1592 - 2018-2019赛季多校联合新生训练赛第二场 D 10248 修建高楼(模拟优化) H 10252 组装玩具(贪心+二分) D 传送门 题干 题目描述 C 市有一条东西走向的“市河”.C 市的市长打算在“市河”的其中一条岸边自东往西的 n 个位置(可以将这 n 个位置看成在一条直线上,且位置不会重叠)依次建造高楼. C 市的设计部门设计了 T 个方案供市长挑选(方案编号为 到 T).每个方案都提供了建造的每幢高楼的高度,自东向西依次为 h1,h2,h3,…,hn-,…
Contest1585 - 2018-2019赛季多校联合新生训练赛第一场 C 10187 查找特定的合数 D 10188 传话游戏 H 10192 扫雷游戏 C 传送门 题干: 题目描述 自然数中除了能被1和本身整除外,还能被其他数整除的数叫合数.每个合数都可以写成几个质数相乘的形式,这几个质数都叫做这个合数的质因数.比如8=××,2就是8的质因数.在1—N(N≤)按从小到大顺序排列的自然数序列中,查找第M个有X(≤X≤)个不同质因数的合数.例如,第3个有2个不同质因数的合数是12(12只有2…
第一次就去拉了点思维很神奇的CF题目 2018省赛赛第一次训练 # Origin Title A CodeForces 607A Chain Reaction B CodeForces 385C Bear and Prime Numbers C CodeForces 670D2 Magic Powder - 2 D CodeForces 360B Levko and Array E CodeForces 68B Energy exchange F…
Runtime Error Bahosain was trying to solve this simple problem, but he got a Runtime Error on one of the test cases, can you help him by solving it? Given an array of N non-negative integers and an integer K, your task is to find two integers X and…
Heavy Coins Bahosain has a lot of coins in his pocket. These coins are really heavy, so he always tries to get rid of some of the coins by using them when paying for the taxi. Whenever Bahosain has to pay S pennies for the taxi driver, he tries to…
Travelling Salesman After leaving Yemen, Bahosain now works as a salesman in Jordan. He spends most of his time travelling between different cities. He decided to buy a new car to help him in his job, but he has to decide about the capacity of the…
Epic Professor Dr. Bahosain works as a professor of Computer Science at HU (Hadramout University). After grading his programming exam, he noticed that most of the students have failed. Since this is the last semester for him teaching in Yemen, D…
Street Lamps Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is a lamp in a block, it will light it’s block and the direct adjacent blocks. For example, if there is a lamp at block 3, it will light…
Rock-Paper-Scissors Rock-Paper-Scissors is a two-player game, where each player chooses one of Rock, Paper, or Scissors. Here are the three cases in which a player gets one point: Choosing Rock wins over a player choosing scissors. …