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; const int dx[4]={1,0,-1,0}; const int dj[4]={0,1,0,-1}; int main() { int n,m,k; cin>>n>>m; cin>>k; char x[n][m]; vector
>v; for(int i = 0;i
>x[i][j]; if(x[i][j]=='C'){ v.push_back(make_pair(i,j)); } } } int si; int sj; int cnt[n][m]; for(int i = 0;i
q; si=v[i].first; sj=v[i].second; q.push(si); q.push(sj); q.push(0); vector
>visited(n,vector
(m,false)); while(!q.empty()){ int ci=q.front(); q.pop(); int cj=q.front(); q.pop(); int dist=q.front(); q.pop(); for(int p = 0;p<4;p++){ int ti=ci+dx[p]; int tj=cj+dj[p]; if(ti>=0 && ti
=0 && tj
najgolem and x[i][j] != 'C'){ najgolem=cnt[i][j]; ri=i; rj=j; } } } 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)