Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
using namespace std; int main() { int a,b; cin>>a>>b; char mat[a][b]; bool v[a][b]; for(int i=0;i
>mat[i][j]; v[i][j]=false; } } int k=0; for(int i=0;i
Q; Q.push(i); Q.push(j); while(!Q.empty()) { int ci=Q.front(); Q.pop(); int cj=Q.front(); Q.pop(); if(ci+1
=0 && mat[ci-1][cj]!='-' && v[ci-1][cj]==false) { Q.push(ci-1); Q.push(cj); v[ci-1][cj]=true; } if(cj+1
=0 && mat[ci][cj-1]!='-' && v[ci][cj-1]==false) { Q.push(ci); Q.push(cj-1); v[ci][cj-1]=true; } } k++; } } } cout<
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)