# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
448707 | Antekb | Zoo (COCI19_zoo) | C++14 | 103 ms | 38676 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define st first
#define nd second
using namespace std;
const int N=1005;
int tab[N][N], dist[N][N];
vector<pair<int, int> > co[N*N];
vector<pair<int, int> > V={{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int main(){
int n, m;
cin>>n>>m;
for(int i=0; i<n; i++){
string s;
cin>>s;
for(int j=0; j<m; j++){
if(s[j]=='T')tab[i][j]=1;
if(s[j]=='B')tab[i][j]=2;
}
}
dist[0][0]=1;
co[1].push_back({0, 0});
int ans=0;
for(int i=1; i<=n*m; i++){
for(int j=0; j<co[i].size(); j++){
//cout<<v.st<<" "<<v.nd<<"\n";
ans=max(ans, i);
int x=co[i][j].st, y=co[i][j].nd;
for(pair<int, int> d:V){
if(x+d.st>=0 && y+d.nd>=0 && tab[x+d.st][y+d.nd]){
if(dist[x+d.st][y+d.nd]==0){
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |