# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
484594 | groupATSU | Patkice (COCI20_patkice) | C++14 | 1 ms | 716 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 <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=1e9;
const int maxn=1e3;
const ll mod=998244353;
int a,b;
char g[maxn][maxn];
int used[maxn][maxn];
void clr(){
for(int i=1;i<=a;i++){
for(int t=1;t<=b;t++)used[i][t]=0;
}
}
vector <pair<int,char>> ans;
void DFS(int x,int y,int ind,int cnt){
if(g[x][y]=='.' || used[x][y]==1){
return ;
}
if(g[x][y]=='x'){
used[x][y]=1;
if(ind==2)ans.push_back({cnt,'N'});
else if(ind==1)ans.push_back({cnt,'S'});
else if(ind==3)ans.push_back({cnt,'E'});
else ans.push_back({cnt,'W'});
return ;
}
used[x][y]=1;
if(g[x][y]=='v')DFS(x+1,y,ind,cnt+1);
if(g[x][y]=='^')DFS(x-1,y,ind,cnt+1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |