链接:https://ac.nowcoder.com/acm/problem/205461 王子连接的国服终于上线啦~ 已知王子连接的抽卡系统如下: 共有 个卡池,第 个卡池共有 种卡,每张卡的出货率都是相等的(也就是说该卡池单次抽卡,每种卡出货率是 1/ai1/a_i1/ai? )。 第 个卡池中 ...
分类:
其他好文 时间:
2020-05-19 01:05:12
阅读次数:
88
给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。 来源:力扣(LeetCode) class Solution { public: void moveZeroes(vector<int>& nums) { int index = 0; for (int ...
分类:
移动开发 时间:
2020-05-19 00:16:24
阅读次数:
72
https://leetcode-cn.com/problems/next-permutation/ ...
分类:
其他好文 时间:
2020-05-18 23:00:02
阅读次数:
50
POJ 3259 http://poj.org/problem?id=3259 题意: 农夫 FJ 有 N 块田地【编号 1...n】 (1 include include include using namespace std; const int maxn = 510; const int ma ...
分类:
其他好文 时间:
2020-05-18 22:49:56
阅读次数:
67
题目链接 直接算每次破坏会拆开多少个连通块貌似不可做。考虑反着加边用并查集合并。 那么我们首先用$vector$存下每个点出边到的点的序列。注意:$m\in[1,2\times 10^5]$而$n\in [1,2\times m]$所以$n\in [1,4\times 10^5]$。 读入破坏的顺序 ...
分类:
Web程序 时间:
2020-05-18 22:42:30
阅读次数:
79
"luogu" 因为$C$对答案的贡献只和$\max b_i$有关,所以我们枚举这个值$z$,然后把所有$ z$的$b$全部变成$z$,这里如果$A define LL long long define db double using namespace std; const int N=2e5+1 ...
分类:
其他好文 时间:
2020-05-18 20:29:02
阅读次数:
52
多项式多点求值 https://www.luogu.com.cn/problem/P5050 给出一个 $n$ 次多项式 $f(x)$ ,对于 $i \in [1,m]$ ,求 $f(a_i)$ . 答案对 $998244353$ 取模 $n,m \in [1,64000]$ , $a_i,[x^i ...
分类:
其他好文 时间:
2020-05-18 20:23:53
阅读次数:
71
Least Cost Bracket Sequence(贪心) Describe This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if by inserti ...
分类:
其他好文 时间:
2020-05-18 18:19:11
阅读次数:
52
"题目" 再维护一个iterator ,用来实现peek ...
分类:
其他好文 时间:
2020-05-18 16:15:47
阅读次数:
44
题目连接:https://www.luogu.com.cn/problem/CF3D —————————————————————————————————————————————————————————— 这一题是一个贪心的题目。 先把字符串中的问号都换成右括号,扫过去,如果左括号比右括号多(因为在任 ...
分类:
其他好文 时间:
2020-05-18 14:34:24
阅读次数:
54