随笔 - 72,  文章 - 2,  评论 - 0,  阅读 - 1231
03 2023 档案
SMU Spring 2023 Trial Contest Round 1(周二)(3.21)
摘要:比赛链接 这场前面顺,中间卡,后面用线段树模板过了一道题,剩下两题,倒二题是个背包DP,思想转换很重要 A题. 特判一下i和i-1就可 #include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--) 阅读全文
posted @ 2023-03-26 18:29 IR101 阅读(5) 评论(0) 推荐(0) 编辑
一些板子
摘要:一拓扑排序: #include<bits/stdc++.h> using namespace std; const int N=100005; int idx,ne[2*N],e[2*N],h[N]; int d[N]; int ans[N],cnt; void add(int a, int b){ 阅读全文
posted @ 2023-03-15 20:04 IR101 阅读(3) 评论(0) 推荐(0) 编辑
线段树
摘要:#include<iostream> #include <cstring> #include <algorithm> //#define int long long using namespace std; const int N = 500010; int w[N]; int n,m; struc 阅读全文
posted @ 2023-03-14 14:16 IR101 阅读(3) 评论(0) 推荐(0) 编辑
线性筛法求质数
摘要:#include<bits/stdc++.h> using namespace std; int prime[1000006],cnt; bool st[1000006]; void get_prime(int n){ for(int i=2;i<=n;i++){ if(!st[i]){ prime 阅读全文
posted @ 2023-03-05 16:35 IR101 阅读(2) 评论(0) 推荐(0) 编辑
拓扑排序?
摘要:NEW GAME #include <bits/stdc++.h> using namespace std; const int N=1010; int n,m; int dp[N]; int d[N]; vector<int>g[N]; vector<int>ans; void topo() // 阅读全文
posted @ 2023-03-05 15:27 IR101 阅读(9) 评论(0) 推荐(0) 编辑
把一个数分成质数相乘的形式
摘要:#include<bits/stdc++.h> using namespace std; #define ll long long ll n; ll zi[10005],cnt[10005]; ///转换成质数的积 ll k=0; int main(){ cin>>n; ll p=n; for (l 阅读全文
posted @ 2023-03-04 13:45 IR101 阅读(48) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示