摘要: /* time:O(unknown) space:O(n*n) knowledge:树的直径 step:dfs*2 */ #include<bits/stdc++.h> using namespace std; int n; vector<int> t[105]; bool vis[105]; in 阅读全文
posted @ 2023-11-24 21:19 臧清宇 阅读(31) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int n,id[103],od[103],root; vector<int> G[103]; int ans[103],l; void dfs1(int r){ cout<<r<<" "; if(od[r]= 阅读全文
posted @ 2023-10-06 20:45 臧清宇 阅读(37) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; long long m,n,ans=1,a[5000005]; const long long mod=100000007; long long f(long long x){ long long w=mod- 阅读全文
posted @ 2023-09-22 21:27 臧清宇 阅读(22) 评论(0) 推荐(0)
摘要: 问题 B: 最优乘车 #include<bits/stdc++.h> using namespace std; int m,n,vis[501]; vector<int> g[501];int st; void bfs(){ queue<int> q; while(!q.empty())q.pop( 阅读全文
posted @ 2023-07-26 16:35 臧清宇 阅读(53) 评论(0) 推荐(1)
摘要: 问题 C: 信使 #include<bits/stdc++.h> using namespace std; const int INF=0x3f3f3f3f; int n,m; bool vis[2503]; int d[2503]; struct node{ int v,w; }; vector< 阅读全文
posted @ 2023-07-26 16:27 臧清宇 阅读(62) 评论(0) 推荐(1)
摘要: 问题 E: 【提高】加勒比海盗之世界末日 #include<bits/stdc++.h> using namespace std; int n,j; int main(){ cin>>n; for(int i=1;i<=n;i++){ int s=0; for(int j=1;j<=n;j++){ 阅读全文
posted @ 2023-07-25 15:21 臧清宇 阅读(19) 评论(0) 推荐(0)
摘要: 问题 A: 铲雪车问题 #include<bits/stdc++.h> using namespace std; int main(){ long long x,y; long long a,b,c,d; double s; cin>>x>>y; while(cin>>a>>b>>c>>d){ s+ 阅读全文
posted @ 2023-07-24 11:01 臧清宇 阅读(12) 评论(0) 推荐(0)
摘要: 问题 A: 魔法鲜花 http://www.jzoj.cn/problem.php?cid=5707&pid=0 #include<bits/stdc++.h> using namespace std; int s,t; int vis[100007]; struct node{ int num; 阅读全文
posted @ 2023-07-23 16:59 臧清宇 阅读(42) 评论(0) 推荐(0)
摘要: 1248:Dungeon Master http://ybt.ssoier.cn:8088/problem_show.php?pid=1248 #include<bits/stdc++.h> using namespace std; char a[103][103][103]; int vis[10 阅读全文
posted @ 2023-07-23 16:23 臧清宇 阅读(26) 评论(0) 推荐(0)
摘要: 1272:【例9.16】分组背包 http://ybt.ssoier.cn:8088/problem_show.php?pid=1272 #include<bits/stdc++.h> using namespace std; struct qwert{ int w,v; }a[13][31]; i 阅读全文
posted @ 2023-07-22 16:53 臧清宇 阅读(18) 评论(0) 推荐(0)