B .Counting Inversion 题意:给定L,R,求这个区间的逆序对数之和。(L,R<1e15) 思路:一看这个范围就知道是数位DP。 只是维护的东西稍微多一点,需要记录后面的各种数字的个数cnt,以及逆序对和sum,以及出现了多少种后缀num。 那么枚举到当前位时,假设为i ,那么su ...
分类:
其他好文 时间:
2019-02-09 17:39:14
阅读次数:
322
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 48370 Accepted: 23775 Description Due to recent rains, water has pooled in va ...
分类:
其他好文 时间:
2019-02-05 22:23:45
阅读次数:
210
https://pintia.cn/problem-sets/994805342720868352/problems/994805521431773184 A family hierarchy is usually presented by a pedigree tree. Your job is ...
分类:
其他好文 时间:
2019-02-05 14:19:31
阅读次数:
123
因为参加完wc后心情很差,而且在广州过年没Ubuntu,所以就没打这场比赛了,结果这套题全部1A了,现在看来真是错失良机 ~~结果这场不计rating~~ 今天是除夕,大家节日快乐 A. Lunar New Year and Cross Counting 题意 给定 $n\times n$ 的 $0 ...
分类:
其他好文 时间:
2019-02-04 20:49:21
阅读次数:
197
题解: 操作挺多的一道题 网上证明挺多就不打了 $\sigma_0(n^2) = \sum_{d\mid n} 2^{\omega(d)} = \sum_{d\mid n} \sum_{e\mid d} \mu^2(e) = ((\mu^2 * 1) * 1) (n)$ $(\mu * 1) * 1 ...
分类:
其他好文 时间:
2019-02-03 00:57:26
阅读次数:
210
CodeForces 536 A. Lunar New Year and Cross Counting Description: Lunar New Year is approaching, and you bought a matrix with lots of "crosses". This m ...
分类:
其他好文 时间:
2019-02-01 17:59:20
阅读次数:
215
裸的统计不同的重复出现子串(不重叠)种数的题。多次使用后缀排序要注意小细节。y数组在重复使用时一定要清空,看那个line25 +k就明白了 ,cnt也要清空,为什么就不说了 1 #include 2 using namespace std; 3 typedef long long ll; 4 tem... ...
分类:
编程语言 时间:
2019-01-31 01:25:59
阅读次数:
197
hdu3664 Permutation Counting 题目传送门 题意: 在一个序列中,如果有k个数满足a[i]>i;那么这个序列的E值为k,问你 在n的全排列中,有多少个排列是恰好是E值为k的序列? 思路: 定义dp[i][j]: 在 i 的全排列中,E值为j的个数;则从i转移到i+1时,有三 ...
分类:
其他好文 时间:
2019-01-29 18:03:26
阅读次数:
160
Python的GC模块主要运用了“引用计数”(reference counting)来跟踪和回收垃圾。在引用计数的基础上,还可以通过“标记-清除”(mark and sweep)解决容器对象可能产生的循环引用的问题。通过“分代回收”(generation collection)以空间换取时间来进一步 ...
分类:
编程语言 时间:
2019-01-29 10:50:41
阅读次数:
177
1115 Counting Nodes in a BST (30 分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left su ...
分类:
其他好文 时间:
2019-01-23 15:34:14
阅读次数:
143