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 | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | 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 | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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 |
---|