E. Wilbur and Strings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596/problem/E Description Wilbur the pig now wants to play with strings. He has found an n by m table consisting only of the digits from 0 to 9 where the…
D. Wilbur and Trees Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596/problem/D Description Wilbur the pig really wants to be a beaver, so he decided today to pretend he is a beaver and bite at trees to cut them down. The…
C. Wilbur and Points Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596/problem/C Description Wilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if…
B. Wilbur and Array Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596/problem/B Description Wilbur the pig is tinkering with arrays again. He has the array a1, a2, ..., an initially consisting of n zeros. At one step, he…
A. Wilbur and Swimming Pool Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/596/problem/A Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his back…
C. Wilbur and Points time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Wilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Mor…
A. Wilbur and Swimming Pool time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in…
B. Wilbur and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Wilbur the pig is tinkering with arrays again. He has the array a1, a2, ..., an initially consisting of n zeros. At one…
D. One-Dimensional Battle ShipsTime Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/D Description Alice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n s…
题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <algorithm> using namespace std; ; const int INF = 0x3f3f3f3f;…
水 A - Wilbur and Swimming Pool 自从打完北京区域赛,对矩形有种莫名的恐惧.. #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int main(void) { int n, x[4], y[4]; cin >> n; for (int i=0; i<n; +…
A. Wilbur and Swimming Pool time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in…
http://codeforces.com/problemset/problem/596/B GGGGGGGGGGGGGGGGGGG…
C. Fox And Names 题目连接: http://codeforces.com/contest/510/problem/C Description Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in…
C. Vanya and Scales Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/C Description Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams where w is some integer not less than 2 (…
题目链接:http://codeforces.com/problemset/problem/686/C 给你n和m,问你有多少对(a, b) 满足0<=a <n 且 0 <=b < m 且a的7进制和n-1的7进制位数相同 且b的7进制和m-1的7进制位数相同,还有a和b的7进制上的每位上的数各不相同. 看懂题目,就很简单了,先判断a和b的7进制位数是否超过7,不超过的话就dfs暴力枚举计算就可以了. //#pragma comment(linker, "/STACK:1…
C. Kefa and Park Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/580/problem/C Description Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree con…
http://codeforces.com/problemset/problem/150/B 题意: 给出n,m,k,n表示字符串的长度为n,m表示字符种类个数,k表示每k个数都必须是回文串,求满足要求的不同字符串有多少种. 思路:分奇偶推一下,当k为偶数时,容易发现如果n=k,那么有最多有k/2种不同的字符可填,如果n>k,你会发现此时所有位置都必须一样. 奇数的话会稍微麻烦一点,如果n=k,那么最多有k/2+1种不同的字符可填,如果n>k,你会发现此时最后只有2中不同的字符可填. #inc…
D - DZY Loves Strings 思路:感觉这种把询问按大小分成两类解决的问题都很不好想.. https://codeforces.com/blog/entry/12959 题解说得很清楚啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pai…
E. Dreamoon and Strings 题目连接: http://www.codeforces.com/contest/476/problem/E Description Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates that is defined…
题目链接:http://www.codeforces.com/problemset/problem/281/A题意:将一个英文字母的首字母变成大写,然后输出.C++代码: #include <cstdio> #include <cstring> ]; void solve(char *s) { if (*s >= 'a' && *s <= 'z') *s -= ; while (*s) { putchar(*s); s ++; } } int main(…
B. Kay and Snowflake 题目连接: http://www.codeforces.com/contest/685/problem/B Description After the piece of a devilish mirror hit the Kay's eye, he is no longer interested in the beauty of the roses. Now he likes to watch snowflakes. Once upon a time,…
D. Alyona and Strings 题目连接: http://www.codeforces.com/contest/682/problem/D Description After returned from forest, Alyona started reading a book. She noticed strings s and t, lengths of which are n and m respectively. As usual, reading bored Alyona…
D. DZY Loves Strings 题目连接: http://codeforces.com/contest/444/problem/D Description DZY loves strings, and he enjoys collecting them. In China, many people like to use strings containing their names' initials, for example: xyz, jcvb, dzy, dyh. Once DZ…
题目链接: http://www.codeforces.com/contest/476/problem/E E. Dreamoon and Strings time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining…
A. Set of Strings Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/544/problem/A Description You are given a string q. A sequence of k strings s1, s2, ..., sk is called beautiful, if the concatenation of these strings is st…
传送门:http://codeforces.com/contest/1105/problem/B B. Zuhair and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Given a string ss of length nn and integer kk (1≤k≤n1≤k≤n). The string…
题目链接: http://codeforces.com/problemset/problem/445/A 题解: 这道题是在现场赛的最后一分钟通过的,相当惊险,而且做的过程也很曲折. 先是用递推,结果发现递推下去可能会出现非法的情况(一开始还不知道,坚定不移地认为这种方法是对的.Now,what can I say?) 然后用回溯,就是类似在递推的方式下,如果遇到非法就退回上一步,有了改错的机会.结果,超时.也是,这种方法太暴力了. 最后想到:一个格子的与之相邻的格子(如果能涂色),其颜色必定不…
链接:https://codeforces.com/contest/1105/problem/B 题意: 给一个字符串和k,连续k个相同的字符,可使等级x加1, 例:8 2 aaacaabb 则有aa aa 即x=2. 求最大的k 思路: 第一眼想的是诶个查找,但是绝对会T,就没做,过一个小时才想到可以直接遍历,记录每个字符对应的最大x即可. 代码: #include <bits/stdc++.h> using namespace std; const int MAXN = 200000+10…
A. Alyona and copybooks Problem Description: Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each of the subjects. There are three types of copybook's packs…