E. Well played! time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Max has got himself into popular CCG "BrainStone". As "BrainStone" is a pretty intellectual game, Max…
Educational Codeforces Round 43  A. Minimum Binary Number 显然可以把所有\(1\)合并成一个 注意没有\(1\)的情况 view code //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using namespace std…
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x)…
传送门:http://codeforces.com/contest/976/problem/E 参考:https://www.cnblogs.com/void-f/p/8978658.html 题意: 对于每一个生物,有一个ph值和伤害值.现在有a次使ph值乘2的机会,有b次是伤害值等于ph值得机会. 问最后能得到最大的伤害总和是多少. 思路:自己一开始也想的是贪心,但是贪的姿势不正确.明确,a次一定是给同一个生物放大的.但是至于是对哪一个生物放大,还是要用暴力一个一个去找,而不要对排序后第一个…
C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school computer room there are n servers which are responsible for processing several computing tasks. You know the number of scheduled tasks for each server:…
C. Simple Strings 题目连接: http://www.codeforces.com/contest/665/problem/C Description zscoder loves simple strings! A string t is called simple if every pair of adjacent characters are distinct. For example ab, aba, zscoder are simple whereas aa, add a…
C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/C Description A string is called palindrome if it reads the same from left to right and from right to left. For example "kazak", "oo&q…
A. Minimum Binary Number time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output String can be called correct if it consists of characters "0" and "1" and there are no redundant lead…
题目链接:http://codeforces.com/contest/600/problem/C C. Make Palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A string is called palindrome if it reads the same from left to right an…
题目大意:给你字符串s,和t,字符串s中的'?'可以用字符串t中的字符代替,要求使得最后得到的字符串s(可以将s中的字符位置两两交换,任意位置任意次数)中含有的子串t最多. 解题思路: 因为知道s中的字符位置可以交换无数次,所以只要s中含有可以组成t的字符就一定可以出现子串t.所以就是要令t中的字符数量尽量平均地分布在s中. 代码: #include<iostream> #include<string> using namespace std; ]; int main(){ str…