This is the first time I took part in Codeforces Competition.The only felt is that my IQ was contempted.The problem in Div2 was so...em,how to say,anyway I even daren't to believe.Yesterday I solved two fifths of problems.You see? I'm just a guy full…
最近一场TC,做得是在是烂,不过最后challenge阶段用一个随机数据cha了一个明显错误的代码,最后免于暴跌rating,还涨了一点.TC题目质量还是很高的,非常锻炼思维,拓展做题的视野,老老实实补题吧. div2 250pts 题意:判断s去掉一个字符后能否和t一样. 代码: class DecipherabilityEasy { public: string check(string s, string t) { int n = s.size(); int m = t.size(); !…
#417 Div2 C 题意 给出 n 个货物的基础价格和钱 S ,每个货物的最终价格要加上 购买商品总数 * 商品在原来序列中的序号. 问最多能买多少件,且花费最小. 分析 二分购买商品数量,每次判断前给商品排序. code #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5 + 10; int n; ll S; struct A { int i, num; }a[MA…
#414 Div2 C 题意 两个人每个人都有一串字母序列,他们要替换一个长度为 n 包含问号的新序列,他们每次可以使用自己序列中的字母代替新序列的问号(使用自己序列中的字母后那个字母就会消失),第一个人想要形成的序列字典序尽可能小,第二个人则希望尽可能大,两人操作不失误,第一个人先操作,问形成的新序列. 分析 首先排序,如果 n 为偶数,显然第一个人用到的字母是自己序列的前一半,而后一个人则是自己序列的后一半,一开始两人都尽可能的想要把字典序小的字母或字典序大的字母向前放,直到第一个人所操作到…
Problem Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Description Input Output Print exactly one integer — the beauty of the product of the strings. Sample Input 3aba Sample Output 3 题解:这个题的思维难度其实不大,需要维护什么东西很容易想到,或…
Problem Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Input The first line contains a single integer nn (2≤n≤150000) — the number of kittens. Each of the following n−1lines contains integers xi and yi (1≤xi,…
Problem Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input Output The first line of output should contain "Yes", if it's possible to do a correct evaluation for all the dishes, or "No" otherwis…
Problem Codeforces #548 (Div2) - D.Steps to One Time Limit: 2000 mSec Problem Description Input The first and only line contains a single integer mm (1≤m≤100000,1≤m≤100000). Output Print a single integer — the expected length of the array aa writte…