1 /** 2 problem: http://acm.hdu.edu.cn/showproblem.php?pid=3966 3 裸板 4 **/ 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 11 co... ...
分类:
其他好文 时间:
2019-04-12 23:14:49
阅读次数:
130
题解 一道数论欧拉函数和欧拉定理的入门好题。 虽然我提交的时候POJ炸掉了,但是在hdu里面A掉了,应该是一样的吧。 首先我们需要求的这个数一定可以表示成$\frac{(10^x 1)}{9}\times 8$。 那么可以列出一个下面的方程 $$\frac{(10^x 1)}{9}\times 8= ...
分类:
其他好文 时间:
2019-04-12 15:04:09
阅读次数:
126
HDU - 6184 C - Counting Stars 题目大意:有n个点,m条边,问有一共有多少个‘structure’也就是满足V=(A,B,C,D) and E=(AB,BC,CD,DA,AC)这样一个图形,类似于四边形中间连接了一条对角线。 如果我们把这个四边形拆分的话,其实就是两个共用 ...
分类:
其他好文 时间:
2019-04-12 09:13:21
阅读次数:
166
#include #include #include using namespace std; const int inf=0x3f3f3f3f; int dp[20+3][1000+3],a[20+3][1000+3]; int t,n,m; int main() { scanf("%d",&t)... ...
分类:
其他好文 时间:
2019-04-11 21:03:07
阅读次数:
162
http://acm.hdu.edu.cn/showproblem.php?pid=4622 题意:给出一个字符串和q次询问,每次询问[l,r]区间内不同子串的个数 分析: N<=2000. 我是用后缀自动机预处理出所有区间的不同子串个数。 建立n次后缀自动机。 为什么要建立N次呢? 因为鸭 , 后 ...
分类:
其他好文 时间:
2019-04-10 23:29:44
阅读次数:
239
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3307 Description has only two Sentences Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/3276 ...
分类:
其他好文 时间:
2019-04-10 19:17:31
阅读次数:
146
引入 树状数组用于求区间和,其修改和查询的复杂度都是$O(logn)$,非常好写,比较小巧。 几种基础用法,关于权值树状数组在另一篇博客。 单点修改,区间查询 区间和 HDU 1166 敌兵布阵 模版: c++ include define N 50005 using namespace std; ...
分类:
编程语言 时间:
2019-04-10 15:17:39
阅读次数:
116
For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. ...
分类:
其他好文 时间:
2019-04-10 13:25:35
阅读次数:
131
http://acm.hdu.edu.cn/showproblem.php?pid=3974 Problem Description There is a company that has N employees(numbered from 1 to N),every employee in the ...
分类:
其他好文 时间:
2019-04-10 13:22:19
阅读次数:
130
链接:http://acm.hdu.edu.cn/showproblem.php?pid=2546 思路:如果剩余金额大于五可以任意取,那么肯定是优先把金额最大的最后取,以金额m-5为容量 进行01背包,求得的最大金额加上最后取的物品,就是花费最大的。另外还有一个特殊情况当m<5时,此时什么物品都无 ...
分类:
其他好文 时间:
2019-04-09 20:37:34
阅读次数:
156