codeforces AIM Tech Round 4 div 2】的更多相关文章

·将排序限制于子序列中,又可以说明什么呢? C. Sorting by Subsequences ·英文题,述大意:       输入一个长度为n的无重复元素的序列{a1,a2……an}(1<=n<=105,|ai|<109,将其分成p个不重复的子序列,使得只对每个子序列升序排序,能够在各个子序列排完序后,整个序列也是升序排列好的.求p的最大值,将其输出后并按任意顺序每一行输出每个子序列长度和每个元素排序好的下标. ·分析:       对子序列排序,最终竟然可以使得整个序列都排好序,那…
A:开个桶统计一下,但是不要忘记k和0比较大小 #include<bits/stdc++.h> using namespace std; ]; ]; int main() { int k; scanf("%s%d", s, &k); int n = strlen(s); if(n < k) { puts("impossible"); ; } ; i < n; ++i) { int t = s[i] - 'a'; ++cnt[t]; )…
2017-08-25 15:32:14 writer:pprp 题目: B. Rectangles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given n × m table. Each cell of the table is colored white or black. Find the numbe…
这是我第一次完整地参加codeforces的比赛! 成绩 news standings中第50. 我觉这个成绩不太好.我前半小时就过了前三题,但后面的两题不难,却乱搞了1.5h都没有什么结果,然后在等System test的时候,就有点头绪了,囧.肯定是我在比赛的时候太困了(这是借口吗?). A Save Luke 考你会不会编程. B Making a String 贪心即可.这题是Hack最多的题.幸好我没有被. C Graph and String 注意到,如果某两个点之间没有边,说明其中…
rating又掉下去了.好不容易蓝了.... A..没读懂题,wa了好几次,明天问队友补上... B. Checkpoints 题意:一条直线上n个点x1,x2...xn,现在在位置a,求要经过任意n-1个点的最小路程 题解:分类讨论,乱搞搞总会出来的,我大概写的很笨…… #include <bits/stdc++.h> using namespace std; typedef long long ll; ]; ll cal(ll x, ll a, ll z) { +(z-a) , (z-a)…
A. Find Square time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Consider a table of size n×mn×m, initially fully white. Rows are numbered 11 through nn from top to bottom, columns 11 thr…
http://codeforces.com/contest/709 题目大意:给一个一维的坐标轴,上面有n个点,我们刚开始在位置a,问,从a点开始走,走n-1个点所需要的最小路程. 思路:我们知道,如果你一会儿走左一会儿左右,最后访问n-1个点一定只会让距离更长的,所以我们的策略是刚开始全都往一端走,然后访问完n-1个点即可.刚开始我是分类讨论的...讨论的要死了...不过后来看了一下别人的代码,发现虽然思路是对的,但是过程想麻烦了. 具体看代码吧. 我的乱七八糟的分类讨论 //看看会不会爆in…
A. Diversity time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters,…
B. Recover the String 题目连接: http://www.codeforces.com/contest/708/problem/B Description For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of length 2 of…
A. Letters Cyclic Shift 题目连接: http://www.codeforces.com/contest/708/problem/A Description You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty substring of s and shift all its letters 'z'…