Codeforces Round#413 Problem A - C】的更多相关文章

Problem#A Carrot Cakes vjudge链接[here] (偷个懒,cf链接就不给了) 题目大意是说,烤面包,给出一段时间内可以考的面包数,建第二个炉子的时间,需要达到的面包数,问建炉子是否合理. 玄学 & 智商题,可能是因为我智商不够,所以在我决定休息的时候被hank掉了...(纠正一个错误,是fst掉的) 输NO的情况大概是当炉子建好后,考完第一波的时间,任务已经或刚好完成. Code /** * Codeforces * Problem#799A * Accepted *…
题目链接:https://codeforces.com/problemset/problem/799/C 题意:有 c 块硬币和 d 块钻石,每种喷泉消耗硬币或钻石中的一种,每个喷泉有一个美丽值,问建造两个喷泉可以获得的最大美丽值是多少. 题解:三种情况:买两个消耗硬币的喷泉,买两个消耗钻石的喷泉或各买一个,消耗的范围是1e5,故用树状数组维护之前的最大值,考虑加入当前建造的更新答案. #include <bits/stdc++.h> using namespace std; #define…
Mr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert exactly one lowercase English letter into s to make it a palindrome. A palindrome is a string that reads the same forward and backward. For…
A. Carrot Cakes time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output In some game by Playrix it takes t minutes for an oven to bake k carrot cakes, all cakes are ready at the same moment t minut…
After several latest reforms many tourists are planning to visit Berland, and Berland people understood that it's an opportunity to earn money and changed their jobs to attract tourists. Petya, for example, left the IT corporation he had been working…
Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to the sum of elements in the seco…
Problem A Lucky Year 题目传送门[here] 题目大意是说,只有一个数字非零的数是幸运的,给出一个数,求下一个幸运的数是多少. 这个幸运的数不是最高位的数字都是零,于是只跟最高位有关,只保留最高位,然后加一求差就是答案. Code /** * Codeforces * Problem#808A * Accepted * Time:15ms * Memory:0k */ #include<iostream> #include<cstdio> #include<…
http://codeforces.com/contest/799/problem/C 题意: 有n做花园,有人有c个硬币,d个钻石 (2 ≤ n ≤ 100 000, 0 ≤ c, d ≤ 100 000) ,每一个花园用三个维度描述(a,b,c),分别是美丽度,所花钱币个数,钱币种类,当然,钱币之间不能兑换,该人必须要建筑两座花园,如果可以,输出两座花园总的美丽度,否则输出0: 思路: 首先想到分三种情况讨论,两个花园都用硬币,两个花园都用钻石,一个用钻石一个用硬币. 大神的代码真的是很厉害…
题目链接:http://codeforces.com/contest/799/problem/C 题目: 题意: 给你n种喷泉的价格和漂亮值,这n种喷泉题目指定用钻石或现金支付(分别用D和C表示),C和D之间不能相互转换.你现在需要修建两个喷泉,给你硬币数和现金数,问你怎样才能使修建的两个喷泉的总漂亮值最大. 思路: 易知,要修建的两个喷泉如果一个是用钻石支付,另一个用现金支付,那么只需找到小于给的钻石和现金的上限的漂亮值最大的两个温泉相加,此处遍历一边即可.对于这两个温泉都用同一种支付方式的情…
1) Link to the problem: http://codeforces.com/contest/888/problem/C 2) Description: You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant if each substring of s with length at least k contains this character…