这个专栏开始介绍一些<ACM国际大学生程序设计竞赛题解>上的竞赛题目,读者可以配合zju/poj/uva的在线测评系统提交代码(今天zoj貌似崩了). 其实看书名也能看出来这本书的思路,就是一本题解书,简单暴力的通过题目的堆叠来提升解决编程问题的能力. 那么下面开始探索吧. poj1037: Description Background For years, computer scientists have been trying to find efficient solutions to…
题目链接: http://codeforces.com/problemset/problem/7/D D. Palindrome Degree time limit per test1 secondmemory limit per test256 megabytes 问题描述 String s of length n is called k-palindrome, if it is a palindrome itself, and its prefix and suffix of length…
菜鸡刷题记录 [题号:题解] 1008:简单排列组合 #include <bits/stdc++.h> using namespace std; #define ll long long ; ll n, m; ll qmod(ll base, ll n) { ll res = ; while (n) { ) res = res * base % MOD; base = base * base % MOD; n >>= ; } return res; } int main() { w…
题目大意:给你一个字符串,求出它的最长回文字段 题解:$manacher$算法 卡点:$p$数组未开两倍空间 C++ Code: #include <cstdio> #include <cstring> #define maxn 11000010 char o[maxn], s[maxn << 1]; int p[maxn << 1]; int n; inline int min(int a, int b) {return a < b ? a : b;…