What doe the following code mean ? Why use it ?
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3690 |
2 | jiangly | 3647 |
3 | Benq | 3581 |
4 | orzdevinwang | 3570 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | Radewoosh | 3509 |
8 | ecnerwala | 3486 |
9 | jqdai0815 | 3474 |
10 | gyh20 | 3447 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 165 |
3 | adamant | 161 |
4 | TheScrasse | 160 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | orz | 146 |
8 | SecondThread | 146 |
10 | pajenegod | 145 |
What doe the following code mean ? Why use it ?
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
bool dfs(int r, int c) {
if (r > n || c > m || vis[ndx(r, c)] || grid[ndx(r,c)] == '#') return false;
if (r == n && c == m) return true;
if (r!=1 || c!=1) vis[ndx(r, c)] = true;
return dfs(r+1, c) || dfs(r, c+1);
}
Why Does the previous code terminate once a call is evaluated as true ?
In other words, Why it doesn't mark each reachable cell that does not have "#", as expected ?
How can I find all Div 3 contests ?
When I choose Clang++17 Diagnostics and submit this solution, The verdict is TLE. But
when I choose any GNU G++ and submit the exact same code, It's Accepted.
why ?
Название |
---|