# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
63732 | Bodo171 | Tracks in the Snow (BOI13_tracks) | C++14 | 1561 ms | 119292 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <fstream>
#include <queue>
using namespace std;
const int nmax=4005;
int d[nmax][nmax];
//pair<int,int> q[2][nmax*nmax];
string s[nmax];
int p[2],u[2];
bool E[nmax][nmax];
int use,mx,i,j,dd,n,m,li,ci,lf,cf,di;
int d1[]={-1,0,1,0};
int d2[]={0,-1,0,1};
void dij(int L,int C)
{
deque< pair<int,int> > q;
q.push_back({L,C});
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
d[i][j]=n*m+1;
d[L][C]=0;
while(!q.empty())
{
li=q.front().first;ci=q.front().second;q.pop_front();
for(di=0;di<4;di++)
{
lf=li+d1[di];cf=ci+d2[di];
if(lf>=1&&cf>=1&&lf<=n&&cf<=m&&(s[lf][cf-1]=='R'||s[lf][cf-1]=='F'))
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |