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
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
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) |
Название |
---|