题目地址:http://codeforces.com/contest/459/problem/C C. Pashmak and Buses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Pashmak has been employed in a transportation company. The com…
Problem H. Horrible Truth Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description In a Famous TV Show “Find Out” there are n characters and only one Horrible Truth. To make the series breathtaking all way long, the sc…
题目链接 题意: n个人,k个车,d天.每一个人每天能够坐随意一个车.输出一种情况保证:不存在两个人,每天都在同一辆车上 (1 ≤ n, d ≤ 1000; 1 ≤ k ≤ 109). 分析: 比赛中用的方法麻烦至极...基本想法是均分,这样答案肯定比較优.第一天分到同一辆车上的人在第二天再均分,一直到结束就可以 学习了别人的方法:一个人在所有d天中每天坐哪辆车,能够表示为d位k进制数x. 那么2个人每天都在同一辆车上,就是两个人的x相等.所以我们仅仅要构造出n个不同的d位k进制数即可 这种方法…
题目地址:HDU 4968 这题的做法是全部学科的学分情况枚举,然后推断在这样的情况下是否会符合平均分. 直接暴力枚举就可以. 代码例如以下: #include <cstring> #include <cstdio> #include <math.h> #include <algorithm> using namespace std; int main() { int t, n, a, i, tot, j, k, h, i1, j1, k1, h1, i2,…
题目地址:HDU 4970 先进行预处理.在每一个炮塔的火力范围边界标记一个点. 然后对每一个点的伤害值扫一遍就能算出来. 然后在算出每一个点到终点的总伤害值,并保存下来,也是扫一遍就可以. 最后在询问的时候直接推断就可以,复杂度O(2*n). 代码例如以下: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define maxn 110000 #define…
Codeforces #261 D D. Pashmak and Parmida's problem time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Parmida is a clever girl and she wants to participate in Olympiads this year. Of course s…
传送门 (<---可以点击的~) 时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte 描述 有些英语单词后缀都是一样的,现在我们需要从给定的一堆单词里面找出某个后缀的单词个数. 输入 输入有多组数据.每组第一行输入n,m,0<=n,m<=100000,第二行到n+1行:输入单词,每个单词仅有小写英文字母组成,长度不超过10.第n+2行到n+m+1行,输入要找的单词后缀. 输出 在n个单词里面找出输入单词后缀的单词个数,然后输出.每个数据与数据之…
先上题目+: C. Pashmak and Buses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Pashmak has been employed in a transportation company. The company has k buses and has a contract with a…
C - Pashmak and Buses Codeforces Round #261 (Div. 2) C. Pashmak and Buses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Pashmak has been employed in a transportation company. The…
E - Pashmak and Buses Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 459C Description Recently Pashmak has been employed in a transportation company. The company has k buses and has a c…