03 2022 档案
The 15th Zhejiang Provincial Collegiate Programming Contest
摘要:比赛链接: https://vjudge.net/contest/226750 A - Peak 题目大意: 判断序列是不是先严格单调递增,后严格单调递减。 思路: 先前往后找递增的,然后后往前找递增的,判断位置是不是一样且在 2 ~ \(n - 1\) 上就行。 代码: #include <bit 阅读全文
posted @ 2022-03-31 10:59 Hamine 阅读(87) 评论(3) 推荐(0)
牛客小白月赛46
摘要:Finish 阅读全文
posted @ 2022-03-26 00:13 Hamine 阅读(163) 评论(0) 推荐(0)
Dijkstra
摘要:求最短路(堆优化) #include <bits/stdc++.h> using namespace std; #define LL long long int main(){ ios::sync_with_stdio(false);cin.tie(0); int n, m; cin >> n >> 阅读全文
posted @ 2022-03-23 23:46 Hamine 阅读(102) 评论(0) 推荐(0)
AtCoder Regular Contest 137
摘要:Lucas 阅读全文
posted @ 2022-03-22 17:05 Hamine 阅读(139) 评论(0) 推荐(0)
The 2021 CCPC Weihai Onsite
摘要:比赛链接: https://codeforces.com/gym/103428 A. Goodbye, Ziyin! 题目大意: $n - 1$ 条边连接 $n$ 个点,但是不知道根节点是哪个,判断有多少个节点作为根节点时,树是二叉树。 思路: 当某个节点的度等于 3 的时候,它肯定不能作为根节点。 阅读全文
posted @ 2022-03-20 12:44 Hamine 阅读(393) 评论(0) 推荐(1)
牛客小白月赛39
摘要:Finish 阅读全文
posted @ 2022-03-18 20:19 Hamine 阅读(101) 评论(0) 推荐(0)
函数板子
摘要:**exgcd** ``` //给定 a 和 b,求出 x 和 y,使得 a * x + b * y = gcd(a, b) LL exgcd(LL a, LL b, LL &x, LL &y){ if (!b){ x = 1, y = 0; return a; } LL d = exgcd(b, 阅读全文
posted @ 2022-03-17 19:24 Hamine 阅读(99) 评论(0) 推荐(0)
AtCoder Beginner Contest 243
摘要:dp math 阅读全文
posted @ 2022-03-14 23:56 Hamine 阅读(96) 评论(0) 推荐(0)
Codeforces Round #777 (Div. 2)
摘要:2500 阅读全文
posted @ 2022-03-14 21:04 Hamine 阅读(107) 评论(0) 推荐(0)
Educational Codeforces Round 124 (Rated for Div. 2)
摘要:2600 阅读全文
posted @ 2022-03-14 00:12 Hamine 阅读(73) 评论(0) 推荐(0)
牛客练习赛97
摘要:笛卡尔树 树分块 阅读全文
posted @ 2022-03-11 09:42 Hamine 阅读(79) 评论(0) 推荐(0)
Codeforces Round #776 (Div. 3)
摘要:Finish 阅读全文
posted @ 2022-03-10 18:54 Hamine 阅读(217) 评论(0) 推荐(0)
#1847. [SNOI2017]英雄联盟
摘要:题目链接: http://39.98.219.132/problem/1847 题目大意 有 \(n\) 个英雄,每个英雄有 \(k_i\) 个皮肤,一个英雄所有皮肤的价格相同,都是 \(c_i\),现在希望买皮肤来展示,展示方案就是有皮肤的英雄就选择一个皮肤进行展示,希望花最少的费用使英雄皮肤的展 阅读全文
posted @ 2022-03-10 11:05 Hamine 阅读(62) 评论(0) 推荐(0)
Codeforces Round #770 (Div. 2)
摘要:2400 阅读全文
posted @ 2022-03-08 17:33 Hamine 阅读(62) 评论(0) 推荐(0)
Codeforces Round #771 (Div. 2)
摘要:2400 阅读全文
posted @ 2022-03-07 20:38 Hamine 阅读(60) 评论(0) 推荐(0)
Educational Codeforces Round 123 (Rated for Div. 2)
摘要:2900 fft 阅读全文
posted @ 2022-03-07 00:19 Hamine 阅读(154) 评论(0) 推荐(0)
Codeforces Round #774 (Div. 2)
摘要:2200 阅读全文
posted @ 2022-03-05 18:11 Hamine 阅读(115) 评论(0) 推荐(0)
牛客练习赛66
摘要:比赛链接: https://ac.nowcoder.com/acm/contest/6112 C.公因子 题目大意: 长为 $n$ 的序列 $a$,找到一个非负整数 $x$,使得 $gcd(a_1 + x, a_2 + x,..., a_n + x)$ 最大,输出最大的 $gcd$ 以及使 $gcd 阅读全文
posted @ 2022-03-05 11:48 Hamine 阅读(26) 评论(0) 推荐(0)
离散化
摘要:离散化 #include <bits/stdc++.h> using namespace std; #define LL long long const int N = 3e5 + 10; LL n, m, a[N], s[N]; int main(){ ios::sync_with_stdio(f 阅读全文
posted @ 2022-03-04 13:40 Hamine 阅读(189) 评论(0) 推荐(0)
Codeforces Round #724 (Div. 2)
摘要:2300 阅读全文
posted @ 2022-03-03 21:53 Hamine 阅读(66) 评论(0) 推荐(0)
Codeforces Round #676 (Div. 2)
摘要:2700 阅读全文
posted @ 2022-03-03 19:46 Hamine 阅读(53) 评论(0) 推荐(0)
kmp
摘要:期望时间复杂度 O(n + m),极限 $O(nm)$。 首先输出若干行,每行一个整数,按从小到大的顺序输出 $s_2$​ 在 $s_1$​ 中出现的位置。 最后一行输出 $\lvert s_2 \rvert$ 个整数,第 $i$ 个整数表示 $s_2$ 的长度为 $i$ 的前缀的最长 $borde 阅读全文
posted @ 2022-03-02 13:07 Hamine 阅读(154) 评论(0) 推荐(0)
Codeforces Round #768 (Div. 1)
摘要:2200 阅读全文
posted @ 2022-03-01 19:25 Hamine 阅读(166) 评论(0) 推荐(0)
Codeforces Global Round 19
摘要:2100 阅读全文
posted @ 2022-03-01 16:23 Hamine 阅读(62) 评论(0) 推荐(0)