Codeforces 67A【模拟】】的更多相关文章

题意: 给一个字符串代表相邻学生的比较,L代表左边多,R表示右边多,=表示左右相等. 保证每个人拿糖>=1,在分糖最少的情况下,输出每个学生所分得的糖. 思路: 模拟一下,第一个人一开始拿1个,然后模拟下去,如果是=,那就=前面的,如果是R,那就比前面的多一个,如果是L,最好的情况就是拿1个,但是有可能前面那个也是1,那么就往前更新,如果符号是=,前面那个等于现在的,如果是R,那么直接跳出,不用往前更新了,因为顺序的更新本身就比之前的大了,如果是L只要判断一下前面的是不是和当前的相等,是的话,前…
Prison Transfer Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of t…
Marathon Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Valera takes part in the Berland Marathon. The marathon race starts at the stadium that can be represented on the plane as a square whose…
B. Checkpoints time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Vasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x1, x2, ..., x…
Valera and X Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Valera is a little boy. Yesterday he got a huge Math hometask at school, so Valera didn't have enough time to properly learn the Engli…
Inna and Alarm Clock Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Inna loves sleeping very much, so she needs n alarm clocks in total to wake up. Let's suppose that Inna's room is a 100 × 100 …
题意: 给你k件衣服处理,告诉你洗衣机烘干机折叠机的数量,和它们处理一件衣服的时间,要求一件衣服在洗完之后必须立刻烘干,烘干之后必须立刻折叠,问所需的最小时间. 思路: 1.按照时间模拟 2.若洗完的衣服或者烘干的衣服较多来不及进行下一个步骤,则从一开始就顺延洗衣服的时间,贪心的思想也是体现在这里. 3.关键在于烘干衣服的顺延如何处理,因为需要调整洗衣服的起始时间,其实我们只要对烘干衣服的时间进行顺延处理就可以了,因为即使没有调整洗衣服的起始时间,那么下次到了烘干衣服的时间的时候因为烘干衣服的数…
思路:模拟移动即可,如果球落入洞中停止移动.注意:有可能第一个位置就是洞!! AC代码 #include <cstdio> #include <cmath> #include <cctype> #include <algorithm> #include <cstring> #include <utility> #include <string> #include <iostream> #include <…
https://vjudge.net/problem/CodeForces-864C 题意:两地之间有个加油站,往返走k个单程,最少加油多少次. 大佬几十行代码就解决,我却要用一百多行的if语句模拟解决. #include<stdio.h> #include<iostream> #include<algorithm> #include<cstring> #include<math.h> #include<string> #includ…
C. Letters Cyclic Shift time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty su…