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 n,m,kolku; int dr[1005] = {-1, 0, +1, 0}; int dc[1005] = {0, +1, 0, -1}; int vis[1005][1005]; int s[10]; int cnt[20]; char mat[1005][1005]; //koj polinja gi ima koj vo sekoj moment queue
Q[20]; int main() { ios_base::sync_with_stdio(false); cin>>n>>m>>kolku; for(int i=0;i
>s[i]; } for(int i=0;i
>mat[i][j]; vis[i][j]=false; } } for(int i=0;i
>v; while(!Q[i].empty()) { int r=Q[i].front(); Q[i].pop(); int c=Q[i].front(); Q[i].pop(); int d=Q[i].front(); Q[i].pop(); // cout << i + 1 << " " << r + 1 << " " << c + 1 << " " << d <
=0 && nc
=0 && vis[nr][nc]==false && mat[nr][nc]=='.' && d - 1 >= 0) { Q[i].push(nr); Q[i].push(nc); Q[i].push(d-1); v.push_back({nr,nc}); vis[nr][nc]=true; cnt[i]++; } } } for(int j=0;j
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)