
牛客算法入门题单
文章平均质量分 58
牛客算法入门班的题单
辉小歌
九局下半转啊转,我把帽子反戴,还在期待逆转。
展开
-
2021算法竞赛入门班第九节课【线段树】练习题
题单地址:https://ac.nowcoder.com/acm/problem/collection/1265?asc=true&order=difficulty目录情人节的电灯泡【二维树状数组 / 单点修改 区间查询】情人节的电灯泡【二维树状数组 / 单点修改 区间查询】#include<bits/stdc++.h>using namespace std;const int N=1e3+10;int tr[N][N],a[N][N],n,m;int low.原创 2022-03-23 23:54:57 · 201 阅读 · 0 评论 -
2021算法竞赛入门班第十节课【字符串】练习题
目录救救企鹅【KMP】救救企鹅【KMP】https://ac.nowcoder.com/acm/problem/20862KMP匹配,记录匹配的开始下标。#include<bits/stdc++.h>using namespace std;const int N=1e6+10;char s[N],a[N],b[N];int ne[N],n,m;unordered_map<int,int>mp;int main(void){ cin>>s+1原创 2021-12-16 09:57:50 · 564 阅读 · 0 评论 -
2021算法竞赛入门班第八节课【数学】习题
目录)最大公约数(lcm)[NOIP2011]计算系数【组合数】大水题【容斥定理】最大公约数(lcm)https://ac.nowcoder.com/acm/problem/16710#include<bits/stdc++.h>using namespace std;typedef long long int LL;LL a,b;LL gcd(LL a,LL b){return b?gcd(b,a%b):a;}int main(void){ cin>>a>原创 2021-12-14 21:24:49 · 707 阅读 · 0 评论 -
2021算法竞赛入门班第七节课【图论】练习题
目录挖沟【最小生成树板子题】公交线路【最短路板子题】挖沟【最小生成树板子题】https://ac.nowcoder.com/acm/problem/17509#include<bits/stdc++.h>using namespace std;struct node{int a,b,c;}temp;bool cmp(node a,node b){return a.c<b.c;}const int N=1e5+10;int n,m,a,b,c,p[N];int find(原创 2021-12-12 14:56:05 · 574 阅读 · 0 评论 -
2021算法竞赛入门班第四节课【搜索】练习题
目录Jelly【简单bfs】maze【建图求最短路】wyh的迷宫【BFS】Jelly【简单bfs】https://ac.nowcoder.com/acm/problem/201613#include<bits/stdc++.h>using namespace std;const int N=110;struct node{int x,y,z,step;};char a[N][N][N];int st[N][N][N],n;int dx[6]={-1,0,0,1,0,0};i原创 2021-12-12 13:12:48 · 637 阅读 · 0 评论 -
2021算法竞赛入门班第三节课【堆、栈、队列、并查集】等习题
目录新建 Microsoft Office Word 文档【小根堆】加边的无向图【并查集】好串【栈 / 括号匹配】[NOIP2004]合并果子【小根堆】DongDong认亲戚【并查集】新建 Microsoft Office Word 文档【小根堆】https://ac.nowcoder.com/acm/problem/17889用小根堆来维护一个删除掉的编号,即现在剩余的编号。在用一个编号存目前最大的编号。当小根堆内有元素就拿堆里的,没有的话就向后延申。#include<bits/stdc原创 2021-12-10 16:18:30 · 548 阅读 · 0 评论 -
2021算法竞赛入门班第二节课【递归、分治、二分】练习题
目录华华给月月准备礼物【二分】The Biggest Water Problem【模拟】华华给月月准备礼物【二分】https://ac.nowcoder.com/acm/problem/23049就是一个常见的二分模板#include<bits/stdc++.h>using namespace std;typedef long long int LL;const int N=1e5+10;LL a[N],n,k;bool check(int x){ int cnt=0;原创 2021-12-09 15:50:01 · 1041 阅读 · 0 评论 -
2021算法竞赛入门班第一节课【枚举、贪心】习题
目录[USACO 2007 Jan S]保护花朵【经典贪心】[NOIP2005]校门外的树【区间合并】[NOIP2006]明明的随机数【签到】[HNOI2003]激光炸弹【二维前缀和】铺地毯【枚举】[NOIP2007]纪念品分组【模拟】[NOIP2016]回文日期【日期模拟】[NOIP1998]拼数【经典贪心题】毒瘤xor【贪心】字符串【双指针】数学考试【贪心 前缀和】「土」秘法地震【二维前缀和】丢手绢【取尺法 双指针】[NOIP2008]排座椅【贪心】[USACO 2007 Jan S]保护花朵【经典贪原创 2021-12-05 22:04:14 · 1018 阅读 · 0 评论