# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
48452 | Pajaraja | Tracks in the Snow (BOI13_tracks) | C++17 | 1879 ms | 685748 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int t[4007][4007],vi[4007][4007],n,m;
queue<pair<int,int> > q[3];
void dfs(int x,int y,int k)
{
if(x<0 || y<0 || x>=n || y>=m || vi[x][y]) return;
if(t[x][y]!=k)
{
if(t[x][y]==3-k) q[3-k].push(make_pair(x,y));
return;
}
vi[x][y]=true;
dfs(x-1,y,k);
dfs(x+1,y,k);
dfs(x,y-1,k);
dfs(x,y+1,k);
}
int main()
{
int sol=0;
cin>>n>>m;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
for(int j=0;j<m;j++) t[i][j]=(s[j]=='F'?2:(s[j]=='R'?1:0));
}
q[t[0][0]].push(make_pair(0,0));
for(int i=0;i<16000000;i++)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |