CodeForces 152C Pocket Book】的更多相关文章

Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 152C Description One day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exa…
http://codeforces.com/problemset/problem/152/C 题意:给出n条长度为m的字符串,对于第一条字符串的每个位置利用第2~n条字符串的相应位置的字符去替换相应的位置,问能构造出多少种字符串. 思路:因为每个能交换的位置是固定的,所以交换之后那个位置始终由在那个位置的字符组成.那么假设第i个位置可以取x种字符,第j个位置可以取y种字符,那么它们构造出的字符串的种类为x*y种,以此类推,最后的数目是等于每个位置的字符的种数相乘. #include <cstdi…
A - Marks CodeForces - 152A 题意:给出一个学生人数n,每个学生的m个学科成绩(成绩从1到9)没有空格排列给出.在每科中都有成绩最好的人或者并列,求出最好成绩的人数 思路:求每列成绩中最大的数的个数.求出每列成绩中的最大值,遍历每列的各行若值与最大值一样就用另一个数组标记出来,最后遍历标记数组记录下总个数,即为最终结果. 代码: #include<bits/stdc++.h> using namespace std; int main() { int n,m; cin…
题目传送门 /* 题意:每一次任选i,j行字符串进行任意长度前缀交换,然后不断重复这个过程,问在过程中,第一行字符串不同的个数 组合数学题:每一列不同的字母都有可能到第一行,所以每列的可能值相乘取模就行了.这题主要坑在题意理解上... */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <map> using namespac…
Codeforces Round #108 (Div. 2) C. Pocket Book 题意 给定\(N(N \le 100)\)个字符串,每个字符串长为\(M(M \le 100)\). 每次选择\(i, j, k\),然后交换串\(i\)和串\(j\)的长度为\(k\)的前缀. 操作可以做任意次,求最多能得到多少不同的字符串,\(modulo (10^9+7)\). 思路 相当于每个位置的可选字符为该列的不同字符的数量. 代码 C. Pocket Book D. Frames 题意 给定…
B. A Lot of Joy Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/A Description Two boys Gena and Petya wrote on two strips of paper the same string s that consisted of lowercase Latin letters. Then each boy took o…
A. Anastasia and pebbles time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she…
Codeforces Codeforces Round #484 (Div. 2) E. Billiard 题目连接: http://codeforces.com/contest/982/problem/E Description Consider a billiard table of rectangular size $n \times m$ with four pockets. Let's introduce a coordinate system with the origin at t…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…