Mutiples on a circle Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 171    Accepted Submission(s): 28 Problem Description Tom has a necklace with n jewels. There is a number on each jewel. Now…
Editor Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 118    Accepted Submission(s): 38 Problem Description   Sample Input 8 I 2 I -1 I 1 Q 3 L D R Q 2   Sample Output 2 3 Hint The following…
Terrorist’s destroy Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 24    Accepted Submission(s): 6 Problem Description There is a city which is built like a tree.A terrorist wants to destroy th…
Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 300    Accepted Submission(s): 135 Problem Description MMM got a big big big cake, and invited all her M friends to eat the cake toge…
Arc of Dream Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description An Arc of Dream is a curve defined by following function:wherea0 = A0ai = ai-1*AX+…
Prince and Princess Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 150    Accepted Submission(s): 46 Problem Description There are n princes and m princesses. Princess can marry any prince. But…
GCD of Sequence Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 46    Accepted Submission(s): 14 Problem Description Alice is playing a game with Bob.Alice shows N integers a1, a2, …, aN, and M,…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4669 考察对取模的的理解深不深刻啊,当然还有状态的设计····设d[i][j]表示以第i个数结尾,余数为j的取法数,那么在第i个数后加一个数 那么有递推式int yu =(  j *  log10( a[i+1] ) + a[i+1] )%k, d[i+1][yu] += d[i][j] .考虑到这是一个环这样多生成了一个余数,这个余数应该减去,还有++d[i+1][a[i+1]%k]. 贴代码:…
题目链接 这是最早看懂题意的一题,状态转移,挺好想..但是比赛时候,就是没有想到怎么去重,而且当时有些情况,也没注意到. 先预处理的dp[0]的情况,就是以p[0]为结尾的情况.之后D就行了,例如样例此位6,去重只要把642896 去掉就行了,dp[1][642896%m] --;注意这个值的更新. 突然发现. #include <cstdio> #include <cstring> using namespace std; #define LL __int64 ][]; ]; ]…
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 题意:给出一个环,每个点是一个数字,取一个子串,使得拼接起来的数字是K的倍数. 由于K不大,暂且不考虑环的话,那么dp[i][j]表示以i结尾的,模K为j的有多少个子串. 那么sigma (dp[i][0])便是不考虑环的答案. 考虑环的话,不知道别人怎么写的,我感觉我的写法不是很复杂. 环和情况1 和n肯定是必选的,那么便是一个前缀为后缀,一个后…
题意:给你N个珠宝和一个K,每个珠宝上面都有数字,这个珠宝做成项链,把珠宝上的数字拼起来如果可以整除掉K,那么久说这个数字为wonderful value,问你有多少种方案可以组成WONDERFUL VALUE. 对每个数取余并记录多少位,这样的话拼数的时候好操作.详细解法贴个结题报告吧. 代码: #include <iostream> #include <stdio.h> using namespace std; ][]; ]; ]; <<]; int digit(i…
参考了官方题解给的方法: 对于处理循环,官方给了一种很巧妙的方法: #include <cstdio> #include <cstring> #include <cstdlib> #define LL long long int ; ; int N, K; int dp[MAXN][MAXMOD]; int val[MAXN]; ]; ]; void init() { ; i < ; ++i ) len[i] = ; ; i < ; ++i ) len[i]…
Integer Partition Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22    Accepted Submission(s): 15 Problem Description Given n, k, calculate the number of different (unordered) partitions of n s…
Sad Love Story Time Limit: 40000/20000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 16    Accepted Submission(s): 2 Problem Description There's a really sad story.It could be about love or about money.But love wi…
Building Fence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 171    Accepted Submission(s): 25Special Judge Problem Description Long long ago, there is a famous farmer named John. He owns a bi…
Divide Groups Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423    Accepted Submission(s): 161 Problem Description   This year is the 60th anniversary of NJUST, and to make the celebration mor…
Save Labman No.004 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 624    Accepted Submission(s): 154 Problem Description Due to the preeminent research conducted by Dr. Kyouma, human beings hav…
Y Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 60    Accepted Submission(s): 20 Problem Description   Sample Input 4 1 2 1 3 1 4   Sample Output 1 Hint 1. The only set is {2,3,4}. 2. Please…
Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 94    Accepted Submission(s): 41 Problem Description   Sample Input 2   Sample Output 2 Hint 1. For N = 2, S(1) = S(2) = 1. 2. The input fil…
Answers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 25    Accepted Submission(s): 16 Problem Description   Sample Input 2 4 2 2 2 1 0 1 2 3   Sample Output NO YES YES YES   Source 2013 Mul…
Front compression Time Limit: 5000/5000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 158    Accepted Submission(s): 63 Problem Description Front compression is a type of delta encoding compression algorithm wher…
Mine Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 51    Accepted Submission(s): 6 Problem Description Have you ever played a game in Windows: Mine?This game is played on a n*m board, just lik…
String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 11    Accepted Submission(s): 4 Problem Description Given 3 strings A, B, C, find the longest string D which satisfy the following rules:a)…
Backup Plan Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 93    Accepted Submission(s): 36Special Judge Problem Description Makomuno has N servers and M databases. All databases are synchroniz…
Hyperspace Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 67    Accepted Submission(s): 32 Problem Description The great Mr.Smith has invented a hyperspace particle generator. The device is v…
题意 N个数的圆环上有多少种方案可以使得选出来的一段数是K的倍数(N<=50000, K<=200, a[i]<=1000). 思路 多校第七场1004.圆上的DP--大脑太简单处理一些细节时总是短路= =-- 我处理圆的方法是把圆环展开成2*N个数.我们设以第i个数结尾的所有段,按照 mod k 的余数分类的方案数为hash[i][r],r 表示余数.那么如果我们在段末尾加上i+1,我们就可以仅根据余数来确定这些段在添加了第i+1个数之后mod K的余数是(r*exp(10,digit…
Warm up 2 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 28    Accepted Submission(s): 8 Problem Description Some 1×2 dominoes are placed on a plane. Each dominoe is placed either horizontally…
Vases and Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 38    Accepted Submission(s): 10 Problem Description Alice is so popular that she can receive many flowers everyday. She has N v…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 进制转换. 现场根据题目给的两个公式,不断更新!!! 胡搞就可以了. 现场3A,我艹,一次循环开大TLE,一次开小WA,太逗了,呵呵 现场源码: #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #in…
Hard Disk Drive Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 83    Accepted Submission(s): 48 Problem Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (H…