#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 100; const int maxm = 1e6 + 100; co ...
分类:
其他好文 时间:
2020-07-11 21:14:46
阅读次数:
65
比较好的一道贪心题. code: #include <set> #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #define N 100009 #define ll long long #def ...
分类:
其他好文 时间:
2020-07-11 12:50:00
阅读次数:
60
牧场的安排 具体见代码: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int mod = 1e8; 5 6 // dp[i][j]:第i行,第j种状态的方案数 7 int n, m ...
分类:
其他好文 时间:
2020-07-10 21:10:53
阅读次数:
63
最后开long long过了, 心累, 摸了, 明天再写 # include <iostream> # include <cstdio> # include <cstring> # define LL long long # define MAXN 22 using namespace std; i ...
分类:
其他好文 时间:
2020-07-10 18:35:17
阅读次数:
50
只需要用二进制来表示50个数,这样不会超过ll范围 之后按照dfs建树后建线段树维护 #include<iostream> #include<algorithm> #include<stack> #include<vector> #include<cstring> using namespace s ...
分类:
其他好文 时间:
2020-07-10 00:39:02
阅读次数:
94
先求一下lca,之后比较一下给定两点的lca与所求点的关系后分类讨论 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+10; int h[N],ne[N],e[N],idx; int ...
分类:
其他好文 时间:
2020-07-09 23:58:04
阅读次数:
88
实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll"输 ...
分类:
其他好文 时间:
2020-07-09 22:27:00
阅读次数:
65
实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll"输 ...
分类:
其他好文 时间:
2020-07-09 12:16:10
阅读次数:
68
编译原理语法分析——LL(1) Parser
讲解了first集、follow集、parsing table、stack parsing的过程,以及一些二义性消除方法——左因式提取、左递归消除。 ...
分类:
其他好文 时间:
2020-07-09 09:23:52
阅读次数:
152
用线段树维护区间剩余的最大值,这样可以辅助二分,越左越好 对于用完k堆的,直接将他的值变为0即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=6e5+10; struct node{ i ...
分类:
其他好文 时间:
2020-07-07 23:39:52
阅读次数:
91