Super-palindrome 题目描述 You are given a string that is consisted of lowercase English alphabet. You are supposed to change it into a super-palindrome string in minimum steps. You can change one character in string to another letter per step. A string i…
Cardboard Container Problem Description fidget spinners are so 2017; this years' rage are fidget cubes. A fidget cube is a cube with unit side lengths, which you hold in your hand and fidget with. Kids these days,right? You work in the planning depar…
Odd Gnome 题目描述 According to the legend of Wizardry and Witchcraft, gnomes live in burrows underground, known as gnome holes. There they dig up and eat the roots of plants, creating little heaps of earth around gardens, causing considerable damage to…
Ground Defense 题目描述 You are a denizen of Linetopia, whose n major cities happen to be equally spaced along an east-west line. In fact, they are often numbered in order from 1 to n, where 1 is the westmost city and n is the eastmost city. Linetopia wa…
Hou Yi's secret Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1881    Accepted Submission(s): 450 Problem Description Long long ago, in the time of Chinese emperor Yao, ten suns rose into the…
题意:求定 n 个数,求有多少对数满足,ai^bi = x. 析:暴力枚举就行,n的复杂度. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include <c…
/* 将给定的一个字符串分解成ABABA 或者 ABABCAB的形式! 思路:暴力枚举A, B, C串! */ 1 #include<iostream> #include<cstring> #include<cstdio> #include<string> using namespace std; string str; ]; int main(){ int t; scanf("%d", &t); getchar(); while…
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12886&courseid=274 解题报告:输入4个数,要你判断用 + .- . * ./.四种运算能不能得到一个结果为24的式子,可以用括号. 解释一下测试的第四组样例:应该是6 / (1 - 3 / 4) 暴力枚举三种符号分别是什么,然后枚举这三种符号运算的顺序,然后枚举这四个数字的24种排列方式,时间是4^3 * 6 * 24 然后注意要用double型,…
题目链接 题意:中文题. 题解:暴力枚举. #include <iostream> #include <cstring> using namespace std; ; ; char num[MAXS]; int main(int argc, const char * argv[]) { while (cin >> num) { ; int len = (int)strlen(num); ; ; i < len; i++) { ') { > MINK) { M…
题目链接: http://www.codeforces.com/contest/666/problem/B 题意: 给你n个城市,m条单向边,求通过最短路径访问四个不同的点能获得的最大距离,答案输出一个满足条件的四个点. 题解: 首先预处理出任意两点的最短距离,用队列优化的spfa跑:O(n*n*logn) 现依次访问四个点:v1,v2,v3,v4 我们可以枚举v2,v3,然后求出v2的最远点v1,v3的最远点v4,为了保证这四个点的不同,直接用最远点会错,v1,v4相同时还要考虑次最远点来替换…