Error writing to output file - write (28: No space left on device) [IP: 91.189.88.142 80] Fetched 18.4 MB in 18s (1028 kB/s) Reading package lists... ...
分类:
其他好文 时间:
2020-10-09 21:20:39
阅读次数:
26
模板 \(Problem:\) 求 \(n\) 个模式串在文本串中出现的次数 \(templete:\) \(Luogu5357\) \(Code\) #include<cstdio> #include<cstring> using namespace std; const int N = 2e5 ...
分类:
其他好文 时间:
2020-10-08 18:13:37
阅读次数:
17
ZOJ-4123 Happy Equation 链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827370518 题意:求x∈{1,2,.....,2^p}使得a^x≡x^a(mod 2^p),满足的x个数为多少个。 分析: ...
分类:
其他好文 时间:
2020-10-06 20:47:21
阅读次数:
25
链接:https://leetcode-cn.com/problems/number-of-islands/ // flood fill class Solution { public: vector<vector<char>> g; int dx[4] = {-1, 0, 1, 0}, dy[4] ...
分类:
其他好文 时间:
2020-10-06 20:13:28
阅读次数:
25
题目链接 Solution 调了一整天...自毙了... 首先将询问离线,按照右端点从小到大排序。假设我们已经知道了 \([l,r-1]\) 的答案,现在将 \(a_r\) 加入更新答案。显然只需要考虑 \(a_r\) 对答案的贡献。 ...
分类:
其他好文 时间:
2020-10-06 20:08:30
阅读次数:
22
T1 problem: 给定一维空间内若干区间和一些点,要求选出其中某些区间(不能不选)使得存在一个点属于给定点集满足此点被每一个选出区间所包含 求选择的方案数 data range: \(N<=10^5\) solution: 对于每一个点考虑 将点按照位置从小到大排序 如果当前有A个区间包含此点 ...
分类:
其他好文 时间:
2020-10-06 19:56:16
阅读次数:
28
Problem: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors ...
分类:
编程语言 时间:
2020-10-05 22:34:28
阅读次数:
52
题目链接:https://www.luogu.com.cn/problem/P3964 思路:可以发现题目中是求切比雪夫距离和最小,可以先把切比雪夫距离转换成曼哈顿距离。比雪夫距离(x,y),转换成曼哈顿距离就变成了( (x+y)/2,(x-y)/2 )。为了避免浮点数,可以先不除2,最后结果再除2 ...
分类:
其他好文 时间:
2020-10-05 22:25:12
阅读次数:
23
ALGS4 Exercise 1.5.15 Problem Binomial trees. Show that the number of nodes at each level in the worst-case trees for weighted quick-union are binomia ...
分类:
编程语言 时间:
2020-10-05 21:48:17
阅读次数:
42
题目链接 题意:给你n和m,令x为前m个素数,一共使用n个的乘积,例如n=3,m=2,则x=2*2*3或x=2*3*3,求所有Φ(x)的和。 思路:用到了欧拉函数的性质,首先对于x为素数,Φ(x)=x-1,然后若n*m=x,则Φ(n)*Φ(n)=Φ(x)。所以我们可以求出前500个素数,然后对其进行 ...
分类:
其他好文 时间:
2020-09-24 20:50:23
阅读次数:
36