上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 最短路径下多余的边对答案无影响 先预处理节点1到每个节点的最短路 如果当前权值加上上一个点的最短路和这个最短路相等则当前路径满足并记录节点编号 #include <iostream> #include <cstring> #include <algorithm> #include <vector> 阅读全文
posted @ 2021-06-06 18:50 Acception 阅读(34) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstring> #include <vector> using namespace std; using ll = long long ; const int M=1e6+10; int n,x,dep[M],mx[M],dp[M];// 阅读全文
posted @ 2021-06-02 11:57 Acception 阅读(95) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long ; const int N=20,M=1<<N; ll dp[M][N+10],a[22][22]; int main() { ios::sync_with_stdi 阅读全文
posted @ 2021-06-01 10:15 Acception 阅读(26) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define please return #define ac 0 using namespace std; using ll = long long ; bool vis[1003]; void solve() { int n,m; cin>>n 阅读全文
posted @ 2021-05-31 10:15 Acception 阅读(45) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> using namespace std; using ll = long long ; const int N=2e5+10; ll f[N],g[N],size1[N]; vector<int>gg[N]; void df 阅读全文
posted @ 2021-05-30 11:22 Acception 阅读(21) 评论(0) 推荐(0)
摘要: 公式:f(n)=ln(n)+C+1/(2*n) 当n < 10000时,直接算,大于10000时用公式,其中C≈0.57721566490153286060651209 #include<bits/stdc++.h> using namespace std; const double r = 0.5 阅读全文
posted @ 2021-05-24 12:51 Acception 阅读(829) 评论(0) 推荐(0)
摘要: 一类积性函数的前缀和 https://blog.csdn.net/skywalkert/article/details/50500009 Σn1(n/i)↓ n=20 20 10 6 5 4 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 阅读全文
posted @ 2021-05-23 20:58 Acception 阅读(83) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long; const int maxn=1e6+10; int trie[maxn][26],k,cnt[maxn],fail[maxn]; void insert(char 阅读全文
posted @ 2021-05-23 09:19 Acception 阅读(16) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/11173/C #include <bits/stdc++.h> using namespace std; #define int long long using LL = long long; template <typena 阅读全文
posted @ 2021-05-22 10:49 Acception 阅读(28) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; struct node{ int next,to,val; }e[maxn<<1]; int head[maxn<<1],k; void add(int from 阅读全文
posted @ 2021-05-21 18:48 Acception 阅读(24) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页