上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 28 下一页
摘要: 1、高级保存选项,保存为utf-8 2、清理解决方案 阅读全文
posted @ 2022-08-01 11:00 80k 阅读(715) 评论(0) 推荐(0)
摘要: https://www.bilibili.com/read/cv13020375/ https://files.cnblogs.com/files/ECJTUACM-873284962/bigint-10-2-src.7z 作者:C语言编程老师 https://www.bilibili.com/re 阅读全文
posted @ 2022-08-01 10:14 80k 阅读(19) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc261/tasks/abc261_e https://atcoder.jp/contests/abc261/editorial/4490 思路是 f[i]=0或1,fun[i]=0或1 fun[0]表示前面的累计操作会把0变为什么数, f 阅读全文
posted @ 2022-07-25 11:21 80k 阅读(30) 评论(0) 推荐(0)
摘要: set的比较函数必须写成仿函数(class、struct、lambda) 而不能写成函数 且operator()的参数和函数都需要用const修饰 举例: struct cmp { bool operator()(const pair<int, string>& p1,const pair<int, 阅读全文
posted @ 2022-07-24 10:53 80k 阅读(251) 评论(0) 推荐(0)
摘要: 一个序列是括号序列的条件是:在所有位置,前面(含当前位置)的左括号的数量大于等于右括号的数量,且最终相等。 例题: https://codeforces.com/contest/1709/problem/C #include<bits/stdc++.h> using namespace std; t 阅读全文
posted @ 2022-07-24 10:02 80k 阅读(47) 评论(0) 推荐(0)
摘要: cout输出浮点数默认保留六位有效数字。 按照%lf输出,即保留六位小数 cout << fixed << a << endl; View Code 设定保留小数位数 #include<iomanip> cout << setiosflags(ios::fixed) << setprecision( 阅读全文
posted @ 2022-07-23 19:21 80k 阅读(774) 评论(0) 推荐(0)
摘要: 可以证明,此最小距离点为全部点坐标的中位数。 阅读全文
posted @ 2022-07-14 16:22 80k 阅读(55) 评论(0) 推荐(0)
摘要: 拓扑排序用于解决有向无环图的一些相关问题。 priority_queue<pair<int, int>,vector<pair<int,int>>,greater<pair<int, int>>> deg_idx; for (int i = 1; i <= n; i++) { deg_idx.pus 阅读全文
posted @ 2022-07-13 16:39 80k 阅读(88) 评论(0) 推荐(0)
摘要: 设有n个位置,k个小球 由于小球完全相同,需要使用隔板法。 n个位置对应n-1个隔板,再加上k个小球,共n+k-1个位置,来放置小球和隔板 答案为C(n+k-1, k) 例题: 2338. 统计理想数组的数目 https://leetcode.cn/problems/count-the-number 阅读全文
posted @ 2022-07-13 10:50 80k 阅读(72) 评论(0) 推荐(0)
摘要: 并查集初始化为p[i]=i 每次合并时,向右合并 区间大小为sz[find(i)]-1 例题: 2334. 元素值大于变化阈值的子数组 https://leetcode.cn/problems/subarray-with-elements-greater-than-varying-threshold 阅读全文
posted @ 2022-07-13 09:56 80k 阅读(51) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 28 下一页