摘要:
#include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl "\n" typedef long long LL; const int N = 1e5 + 阅读全文 »
发表于 2024-02-05 16:32阅读:11评论:1推荐:0
发表于 2024-02-04 16:02阅读:13评论:0推荐:0
发表于 2024-02-04 15:23阅读:11评论:0推荐:0
摘要:
#include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl "\n" typedef long long LL; const int N = 1e4 + 阅读全文 »
摘要:
#include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl "\n" typedef long long LL; const int N = 30 * 6 阅读全文 »
发表于 2024-02-03 16:26阅读:8评论:1推荐:0
发表于 2024-02-03 15:42阅读:11评论:0推荐:0
发表于 2024-02-03 15:03阅读:6评论:0推荐:0
摘要:
/* 反向考虑,反向建图,考虑从x号点出发,可以到达哪些点,我们从n~1开始枚举 如果某一个点被更新到,呢么这个点一定不会被后面的点更新,就直接可以标记掉,从n号点出发可以到达5号点,呢么从n-1号点出发就 可以直接跳过5号点,还有5号点能到达的点。 复杂度是O(n),这样的想法很常见 */ #in 阅读全文 »
摘要:
#include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) const int N = 200010, M = 2 * 20010, mod = 1e9 + 7; using na 阅读全文 »
摘要:
#include <bits/stdc++.h> const int N = 1e5 + 10, M = 2 * N, mod = 1e9 + 7; using namespace std; int h[N], e[M], ne[M], idx = 0; int n, s, siz[N]; bool 阅读全文 »
发表于 2024-02-02 16:17阅读:32评论:0推荐:0
发表于 2024-02-02 14:21阅读:9评论:0推荐:0
摘要:
/* 差不多的思路,很容易想到按照兔子血量降序排序 之后按照箭的攻击力降序排序,然后把可以杀死兔子的箭全放入小根堆中,选择一个Q币最小的用 */ #include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0) 阅读全文 »
摘要:
/* abddea aeddba 先预处理队列,a['c'],表示c所有出现的位置,用一个pop一次。 找到了右边最近的出现位置k,则看k前面还剩几个元素,剩几个元素答案加几, 在把k位置删除。 */ #include <bits/stdc++.h> #define CLOSE ios::sync_ 阅读全文 »
发表于 2024-02-01 15:14阅读:25评论:3推荐:0
发表于 2024-02-01 15:08阅读:44评论:0推荐:0
摘要:
#include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl "\n" typedef long long LL; const int N = 1e6 + 阅读全文 »
摘要:
/* https://www.acwing.com/solution/content/44886/ 看acwing */ #include <bits/stdc++.h> #define CLOSE ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) 阅读全文 »