-
个人简介
Cut itof~ You↑ have↓ get↗lost~~
传 送 门
百度~优先搜索~ mythware_super_password 这是个病句↓
I am the storm that is aproaching!!!!!!!!!!!!!!!
Manbow~~~ WOW!! Duang~↑↓
我是Halanfus的狗🌹
I·······接下一句; I am the storm that is Aproaching!~!!!!!;
I am FIRE!🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥😡🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥😡🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥😡🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥😡🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
Burn those who dare to care for me~╰(‵□′)╯😈
fly brocken wings;
I know;
you are steel with me;
I need is a nudge to get me started~;
I wanted blood😭;
I wanted Black↓👿 and White↑😇;
I~Must↑be→the↘↗reathen↗↘
↓why↓~↑→😭😥;You must given up your smiles😡!;
Q:我为什么要在主页整这么抽象的活?
A:因为打字真的很豪玩😎;
Halanfus意义明确的单向图深搜啊🍬🍬🌷ψ(._. )>
#include<bits/stdc++.h> //Halanfus到此一游§(* ̄▽ ̄*)§ using namespace std; int n,m,a,b; bool reach,ed[200007]; vector<vector<int> > v(200000); void dfs(int r){ if(ed[r]) return; ed[r]=true; if(!v[r].size()) return; if(!reach){ int s=v[r].size(); for(int i=0;i<s;i+=1){ if(v[r][i]==b){ reach=true; return; } else dfs(v[r][i]); } } else return; } int main(){ cin>>n>>m>>a>>b; int x,y; for(int i=1;i<=m;i+=1){ cin>>x>>y; v[x].push_back(y); } dfs(a); if(reach) cout<<"Yes"; else cout<<"No"; return 0; }
二叉树的前中后综合遍历,试卷上看到的,好用优化一下就搬过来了🍧🍨🍩
#include<bits/stdc++.h> using namespace std; int a[101][3]; bool b[101]; void dfs(int k,int w){ if(w==1) cout<<k<<" ";//前 if(a[k][1]) dfs(a[k][1],w); if(w==2) cout<<k<<" ";//后 if(a[k][2]) dfs(a[k][2],w); if(w==3) cout<<k<<" ";//中 } int main(){ int n,m,t,root; cin>>n; for(int i=1;i<=n;i+=1){ cin>>t; cin>>a[t][1]>>a[t][2]; b[a[t][1]]=1; b[a[t][2]]=1; } for(int i=1;i<=n;i+=1){ if(b[i]==0){ root=i; break; } } dfs(root,1); cout<<endl; dfs(root,2); cout<<endl; dfs(root,3); cout<<endl; return 0; }
-
通过的题目
-
最近活动
This person is lazy and didn't join any contests or homework.
题目标签
- 初窥门径
- 55
- 顺序结构
- 42
- 分支结构
- 9
- 循环结构
- 5
- 一本通编程启蒙
- 2
- while循环
- 1
- 模拟
- 1
- 略有小成
- 1
- 驾轻就熟
- 1
- 递归
- 1