Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got hold of lots of wooden cubes somewhere. They started making cube towers by placing the cubes one on top of the other. They defined multiple t…
D - MUH and Cube Walls Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 471D Description Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo o…
D. MUH and Cube Walls 说实话,这题看懂题意后秒出思路,和顺波说了一下是KMP,后来过了一会确定了思路他开始写我中途接了个电话,回来kaungbin模板一板子上去直接A了. 题意:有两座城堡,每座城堡有一定的形状分别由高度区分.求第一座城堡中有多少个区间的形状和第二座城堡相似.连续一段区间高度可以任意变,但他们的相对位置是不变的. 思路:基于一段连续区间无论怎么变他们的相对位置不会变,所以分别将两个序列相邻的元素作差,一段区间的相对位置不会变,所以正好可以用差值去匹配.所以K…
D. MUH and Cube Walls Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got hold of lots of wooden cubes somewhere. They started making cube towers by placing the cubes one on top of the other.…
[codeforces471D]MUH and Cube Walls 试题描述 Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got hold of lots of wooden cubes somewhere. They started making cube towers by placing the cubes one on t…
Time limit 2000 ms Memory limit 262144 kB Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got hold of lots of wooden cubes somewhere. They started making cube towers by placing the cu…
题目大意 Description 给你一个字符集合,你从其中找出一些字符串出来. 希望你找出来的这些字符串的最长公共前缀*字符串的总个数最大化. Input 第一行给出数字N.N在[2,1000000] 下面N行描述这些字符串,长度不超过20000 .保证输入文件不超过10MB Output 输出一行一个整数代表字符串的最长公共前缀*字符串的总个数的最大值. Sample Input 7 Jora de Sus Orhei Jora de Mijloc Joreni Jora de Jos Ja…
MUH and House of Cards Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 471C Description Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo o…
题目链接:http://codeforces.com/problemset/problem/471/A 题目数据规模1 - 9,可以用一个数组进行计数,减掉出现四次的数,看看还有几个是非零数,有一个就是大象,有两个就是北极熊:如果没有四个数的,那就是Alien. AC代码: #include <cstdio> using namespace std; int cnt[10]; int x, id; int main() { id = 0; cnt[10] = {0}; for (int i =…
Codeforces79C 题意: 求s串的最大子串不包含任意b串: 思路: dp[i]为以i为起点的子串的最长延长距离. 我们可以想到一种情况就是这个 i 是某个子串的起点,子串的长度-1就是最短, 或者这个 前面的长度 +这个i 就是答案. 所以预处理一下,以 i 为起点的最短子串距离就好了,这里利用KMP比较方便. #include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF=0x3f3…
UVa 1625 color length https://blog.csdn.net/Dylan_Frank/article/details/52261424 https://www.cnblogs.com/jerryRey/p/4740944.html Uva-1375 The Best Name for Your Baby(未解决) https://blog.csdn.net/u014258433/article/details/69070747 CodeForces - 17C Bala…