Alphabetic Removals(模拟水题)】的更多相关文章

You are given a string ss consisting of nn lowercase Latin letters. Polycarp wants to remove exactly kk characters (k≤nk≤n) from the string ss. Polycarp uses the following algorithm kk times: if there is at least one letter 'a', remove the leftmost o…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Description A flow layout manager takes rectangular objects and places them in a rectangular window from left to right. If there isn't enough room in one r…
题目链接:http://poj.org/problem?id=2864 题意:参照题目 哈哈哈,这个题discuss有翻译哦.水到我不想交了. #include <cstdio> #include <cstdlib> #include <cstring> ][]; int main(void) { int r, c; int i, j; int flag; || r != ) { memset(arr, , sizeof(arr)); ; i < r; i++)…
题意:蚂蚁在木棍上爬,速度1cm/s,给出木棍长度和每只蚂蚁的位置,问蚂蚁全部下木棍的最长时间和最短时间. 模拟一下,发现其实灰常水的贪心... 不能直接求最大和最小的= =.只要求出每只蚂蚁都走长路下木棍时的最大值,和走短路时的就行了. 代码: /* * Author: illuz <iilluzen@gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: uva10714.cpp * Lauguage: C/C++ * Create Da…
Codeforces 1082B Vova and Trophies https://vjudge.net/problem/CodeForces-1082B 题目: Vova has won nn trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row. The beauty of the arrangement is the le…
一场2012天津网络预选赛的题,签到题. 但是还是写了三四十分钟,C++和STL太不熟悉了,总是编译错误不知道怎么解决. 一开始用的Char [] 后来改成了string,STL和string搭配起来才好用啊. #include <algorithm> #include <iostream> #include <cstring> #include <ctype.h> #include <cstdlib> #include <cstdio&g…
http://acm.hdu.edu.cn/showproblem.php?pid=4891 给出一个文本,问说有多少种理解方式. 1. $$中间的,(s1+1) * (s2+1) * ...*(sn+1), si表示连续的空格数. 2.{}中间,即 | 的个数+1. 就是模拟 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <…
Mishka started participating in a programming contest. There are nn problems in the contest. Mishka's problem-solving skill is equal to kk. Mishka arranges all problems from the contest into a list. Because of his weird principles, Mishka only solves…
题目链接:http://poj.org/problem?id=2459 题目大意:有C头牛,下面有C行,每头牛放进草地的时间,每天吃一个草,总共有F1个草,想要在第D的时候,草地只剩下F2个草. 解题思路:模拟啊,就像砍树一样的问题,把每天失去的草计算出来,从最后一天往前推. #include <cstdio> #include <cstring> int C,F1,F2,D; ]; int main() { while (scanf("%d%d%d%d",&a…