摘要:
2017 Multi-University Training Contest - Team 6 1003 / hdu6098 暴力,思维 tags:有点贼的题。。 题解说的优雅的暴力:将A数组按值从大到小排序,对于每个下标 i 暴力找到最大的不被 i 整除的数。 这样的复杂度其实是在排序的O(n*l 阅读全文
摘要:
2017 UESTC Training for Search Algorithm & String A next[]数组应用 题意:求一个字符串所有前缀出现的次数和。 tags: dp[i-1] = dp[next[i]] + 1。 #include<bits/stdc++.h> using nam 阅读全文
摘要:
Educational Codeforces Round 26 D. Round Subset 题意:有 n 个数,从中选出 k 个数,要使这 k 个数的乘积末尾的 0 的数量最多。 tags:dp好题 dp[i][j][l] 表示前 i 个数,选取了其中 j 个数,分解因子后有 l 个 5时,最多 阅读全文
摘要:
2017 UESTC Training for Math A sg博弈水题 #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,102400000") #define rep(i 阅读全文