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
#include
using namespace std; int main() { int n, m; cin >> n >> m; char mat[n + 1][m + 1]; int si, sj; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { cin >> mat[i][j]; if(mat[i][j] == 'P') { si = i; sj = j; } } } queue
q; q.push(si); // indeks na red q.push(sj); // indeks na kolona q.push(0); // broj na cekori q.push(1); // dali ke se dzizam 1, 2 ili 3 cekori int di1[] = {-1, 1, 0, 0}; int dj1[] = {0, 0, -1, 1}; int di2[] = {-2, 2, 0, 0}; int dj2[] = {0, 0, -2, 2}; int di3[] = {-3, 3, 0, 0}; int dj3[] = {0, 0, -3, 3}; }
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)