Codeforces 801B - Valued Keys】的更多相关文章

B. Valued Keys 题目链接:http://codeforces.com/contest/801/problem/B time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You found a mysterious function f. The function takes two strings s1 and s2.…
801B - Valued Keys 思路: 水题... 来,上代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int len; ],s2[],ans[]; int main() { cin>>s1+; cin>>s2+; len=strlen(s1+); ;i<=len;…
B. Valued Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You found a mysterious function f. The function takes two strings s1 and s2. These strings must consist only of lowercase Eng…
[题目链接]:http://codeforces.com/contest/801/problem/B [题意] 定义一个对两个字符串x,y的f(x,y)函数; 返回的是一个字符串; 这个返回的字符串的每一位i是x和y在相应位置上的字符的较小值; 告诉你x和f(x,y); 求y; [题解] 如果f(x,y)[i]==x[i]则y[i]='z'; 否则 如果f(x,y)[i]>x[i]则y[i]=x[i] 否则 无解 [Number Of WA] 0 [完整代码] #include <bits/s…
原题链接:http://codeforces.com/contest/830/problem/A 题意:在一条数轴上分别有n个人和k把钥匙(n<=k),以及一个目的地,每个人要各自拿到一个钥匙后到达目的地.每个人的移动速度都是1, 问所有人都到达目的地的最短时间. 思路:转化一下题意,就是求耗时最长的人所用的最短时间. 我们可以二分答案x,然后对排序后的人以及钥匙进行枚举,进行从左至右搭配. 这里check函数中返回false的条件是从左至右所有人都能在x的时间内到达目的地,而计算这些人到达目的…
A. Vicious Keyboard time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…
A. Vicious Keyboard 题意:给你一个字符串,里面只会包含VK,这两种字符,然后你可以改变一个字符,你要求VK这个字串出现的次数最多. 题解:数据范围很小,暴力枚举改变哪个字符,然后check就好. #include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans = 0; for(int i=0;i<s.size();i++){ if(s[i]=='V'){…
A. Vicious Keyboard time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…
//yy:拒绝转载!!! 悄悄告诉你,做题累了,去打两把斗地主就能恢复了喔~~~ //yy:可是我不会斗地主吖("'▽'") ~~~那就听两遍小苹果嘛~~~ 五一假期除了花时间建模,就抽空把最近没做的CF题补了点..毕竟明天开始又要继续上好多课呐...Yes, I can!(ง •_•)ง……(I can Huá shuǐ~~) codeforces 803 A. Maximal Binary Matrix   [简单构造] 题意:n行和n列填充零矩阵. 您要将k个1放在其中,使得得到…
D. Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as wel…