找规律 Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks

题目传送门

 1 /*
 2     找规律,水
 3 */
 4 #include <cstdio>
 5 #include <iostream>
 6 #include <algorithm>
 7 #include <cstring>
 8 #include <cmath>
 9 using namespace std;
10
11 const int MAXN = 1e4 + 10;
12 const int INF = 0x3f3f3f3f;
13 char s[22];
14
15 int main(void)        //Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks
16 {
17 //    freopen ("A.in", "r", stdin);
18
19     while (scanf ("%s", s) == 1)
20     {
21         int len = strlen (s);
22         printf ("%d\n", 26 * (len + 1) - len);
23     }
24
25     return 0;
26 }
时间: 2024-10-18 16:06:14

找规律 Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks的相关文章

Codeforces Round #309 (Div. 2) C. Kyoya and Colored Balls

Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one by one until the bag is empty. He noticed that he

贪心 Codeforces Round #309 (Div. 2) B. Ohana Cleans Up

题目传送门 1 /* 2 题意:某几列的数字翻转,使得某些行全为1,求出最多能有几行 3 想了好久都没有思路,看了代码才知道不用蠢办法,匹配初始相同的行最多能有几对就好了,不必翻转 4 */ 5 #include <cstdio> 6 #include <algorithm> 7 #include <string> 8 #include <cmath> 9 #include <iostream> 10 using namespace std; 1

B. Ohana Cleans Up(Codeforces Round #309 (Div. 2))

B. Ohana Cleans Up Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she swe

Codeforces Round #309 (Div. 2) C

题意: 就是给出总共有k种颜色,每种颜色有ki种,排列必须满足第i+1种的最后一种颜色必须在第i种最后一种颜色的后面,其他颜色随意.总共有多少种排列点的方法. 分析: 假设d[i]表示前i种的排列的数量,那么第i+1种的数量就是d[i]*C(a[1]+a[2]+..a[i+1]-1,a[i+1]-1);预先处理好排列组合数就好了,直接计算. ps:CF的比赛时间还真是有点烦,话说我一直不明白为什么我看电视能坚持到两点,打CF就不行呢?于是我就边看电视边打CF~哈哈哈哈 #include <cst

A. Kyoya and Photobooks(Codeforces Round #309 (Div. 2))

A. Kyoya and Photobooks Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photo

C. Kyoya and Colored Balls(Codeforces Round #309 (Div. 2))

C. Kyoya and Colored Balls Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one by one until the bag i

Codeforces Round #309 (Div. 2)

A. Kyoya and Colored Balls 一个背包有K种颜色一共N个球,颜色分别为1,2,3...K,颜色相同的球是不区别的.现在从背包里一个一个拿球直到所有球拿光,在拿光第I+1种颜色球之前一定要拿光第I种颜色的球,求有多少种拿法 如 果只有一种颜色的球,拿的方法只有一种.如果有两种,留下一个颜色为2的放在最后一个,剩下的N1个颜色1和N2-1个颜色2的可以随意摆,方法数为 1*\(N1+N2-1 \choose N2-1\):如果有三种相当于先排好颜色为1,2的,然后剩下N3-1

#309 (div.2) A. Kyoya and Photobooks

1.题目描述:点击打开链接 2.解题思路:本题实质上在问:给定一个长为L的字符串,在26个字符中选一个字符插入该串,可以形成多少个新的字符串.这就是一个简单的计数问题,长度为L的字符串有L+1个空位可以插入,一共有26*(L+1)个方法,考虑到相同字符的情况,要减去一个,一共有L种重复的情况,因此最终有26*(L+1)-L=25*(L+1)+1种情况. 3.代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<al

找规律/贪心 Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones

题目传送门 1 /* 2 找规律/贪心:ans = n - 01匹配的总数,水 3 */ 4 #include <cstdio> 5 #include <iostream> 6 #include <algorithm> 7 #include <cstring> 8 #include <cmath> 9 using namespace std; 10 11 const int MAXN = 2e5 + 10; 12 const int INF =