I got bored with solving and wanted to do something which is related to cp and also very fun so i decided to write this tutorial.bare me for my bad English .
Counting Rooms ==================
explanation
code
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | djm03178 | 152 |
cses graph session editorial(incomplete)
I got bored with solving and wanted to do something which is related to cp and also very fun so i decided to write this tutorial.bare me for my bad English .
Counting Rooms ==================
for each '.' cell we have to made dfs(or bfs) and keep on coloring the visited nodes.we keep track number of dfs by count variable .our answer would be count.
fo(i,0,n){
string s;
cin>>s;
fo(j,0,m){
if(s[j]=='.')grid[i][j]=1;
else grid[i][j]=0;
}
}
int ans=0;
fo(i,0,n){
fo(j,0,m){
if(grid[i][j]==1&&vis[i][j]==-1){
dfs(i,j);
ans++;
}
}
}
cout<<ans<<endl;
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en7 | arham_doshi | 2021-02-11 11:04:59 | 0 | (published) | ||
en6 | arham_doshi | 2020-07-17 07:40:44 | 28 | Tiny change: 'plexity o(nmk).[more ' -> 'plexity o(mk).[more ' | ||
en5 | arham_doshi | 2020-07-01 11:04:56 | 8040 | |||
en4 | arham_doshi | 2020-06-30 16:28:03 | 23 | Tiny change: ' by using floyd warshal complexit' -> ' by using bellman ford complexit' | ||
en3 | arham_doshi | 2020-06-30 09:23:47 | 2734 | (published) | ||
en2 | arham_doshi | 2020-06-29 19:13:30 | 16645 | |||
en1 | arham_doshi | 2020-06-29 16:47:49 | 801 | Initial revision (saved to drafts) |
Name |
---|