[Codeforces 864C]Bus】的更多相关文章

Description A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the point x = a, immediately turns back and then moves to the point x = 0. After returning to the point x = …
题目链接: http://codeforces.com/problemset/problem/711/A 题目大意: N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符串,没有输出NO. 题目思路: [模拟] 签到题.看阅读理解能力和手速. // //by coolxxx //#include<bits/stdc++.h> #include<iostream> #include<algorithm> #include<string&…
题目描述: Bus Number time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output This night wasn't easy on Vasya. His favorite team lost, and he didn't find himself victorious either - although he played p…
题意:给定一个n*4的矩阵,然后O表示空座位,X表示已经有人了,问你是不能找到一对相邻的座位,都是空的,并且前两个是一对,后两个是一对. 析:直接暴力找就行. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #includ…
简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #inc…
题意: 有n排座位,每排有两个座位,每排座位的宽度都不一样. 有2 * n个人要上车,如果是内向的人,那么它会选择一排两个都是空位并且宽度最小的一排去坐: 如果是外向的人,会选择一排座位已经有人坐的,并且宽度最大的一排. 输入数据保证外向的人一定可以找到合适的位置. 问每一个人坐的排数是多少. 思路: 用map存每个长度代表的座位,两个set存没有被占in的和已经被占ex的. 如果是内向的人,每次从没有被占的选择最小的,插入已经被占的,然后从没有被占中擦除: 如果是外向的人,直接从被占的选择一个…
解题思路 将每个数字出现的次数存在一个数组num[]中(与顺序无关). 将出现过的数字i从1到num[i]遍历.(i from 0 to 9) 得到要使用的数字次数数组a[]. 对于每一种a使用排列组合公式:  ans += 上面那个公式.(每用一次这个公式对应一个a) 排列组合公式注解 减号左边表示的是sum个数字全排列并去重. 减号右边表示的是从a[0]中选出一个0当做第一个数字,并对其他数字全排列并去重. 抱歉,写的可能比较混乱,还有部分细节需要读者处理. 代码 #include<bit…
C. Bus time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches…
A. Bus to Udayland 题目连接: http://www.codeforces.com/contest/711/problem/A Description ZS the Coder and Chris the Baboon are travelling to Udayland! To get there, they have to get on the special IOI bus. The IOI bus has n rows of seats. There are 4 sea…
B. Seating On Bus 题目连接: http://www.codeforces.com/contest/660/problem/B Description Consider 2n rows of the seats in a bus. n rows of the seats on the left and n rows of the seats on the right. Each row can be filled by two people. So the total capac…