F - Palindrometer Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4868 Description While driving the other day, John looked down at his odometer, and it read 100000. John was pretty excited about…
题意:给一个的格子图,有 n 行单元格,每行有a[i]个格子,要求往格子中填1~m的数字,要求每个数字大于等于左边的数字,大于上边的数字,问有多少种填充方法. 析:感觉像个DP,但是不会啊...就想暴力试试,反正数据量看起来不大才7,但是...TLE了,又换了一个暴力方法,2秒多过了,差点啊. 其实这是一个状压DP,dp[i][s]表示在第 i 列,在集合 s 中有方法数,那么怎么转移呢,这个还是挺简单的,就是判断第i+1列是不是比第 i 列都大于等于就ok了, 输入时先把行,转化成列,再计算,…
The E-pang Palace Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=217902 Description E-pang Palace was built in Qin dynasty by Emperor Qin Shihuang in Xianyang, Shanxi Province. Itwas the la…
C - Another Brick in the Wall Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4425 Description After years as a brick-layer, you've been called upon to analyze the instability of brick walls. The…
A - String LD Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4423 Description Stringld(left delete) is a function that gets a string and deletes its leftmost character (for instance Stringld(``ac…
B - Bing it Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4764 Description I guess most of you played cards on the trip to Harbin, but I'm sure you have never played the following card game. Thi…
Triples 题目链接: http://acm.hust.edu.cn/vjudge/contest/130303#problem/H Description http://7xjob4.com1.z0.glb.clouddn.com/4c05ed01e62e808388fc90e37554d588 Input The input file contains several test cases, each of them as described below. The first line…
Discrete Logarithm Problem 题目链接: http://acm.hust.edu.cn/vjudge/contest/127401#problem/D Description http://7xjob4.com1.z0.glb.clouddn.com/42600d1bedc3c308a68ea0453befd84e Input The first line of the input file contains a prime p, 1 < p < 2^13 . This…
Sheldon Numbers 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/H Description According to Sheldon Cooper, the best number is 73. In his own words, "The best number is 73. 73 is the 21st prime number. Its mirror, 37, is the 12th, and its m…
ICPC (Isles of Coral Park City) consist of several beautiful islands. The citizens requested construction of bridges between islands to resolve inconveniences of using boats between islands, and they demand that all the islands should be reachable fr…
题目链接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4924 Prime Switch Time limit: 1.000 seconds 问题描述 There are lamps (uniquely numbered from 1 to N) and K switches. Each switch has one p…
就不断地扫整个序列,如果发现多余的括号就删除.大概复杂度还是O(n²)左右.如何判断不合法请详见代码. To a computer, there is no difference between the expression (((x)+(y))(t))and (x+y)t; but, to a human, the latter is easier to read. When writing automatically generated expressions that a human ma…