tkdgus115   4년 전

질문 게시판에 있는 모든 반례를 넣었을때 정답이 나왔습니다.

하지만 제출하면 틀렸다고 나와서 어디가 틀렸는지 모르겠습니다.

tkdgus115   4년 전

int s=q.front().first.first;
int g=q.front().first.second;
int hei=q.front().second.first;
int temp=q.front().second.second;

q.pop();
cnt=temp;
temp++;
if(visit[s][g][hei]==1)
continue;

visit[s][g][hei]=1;
ma[s][g][hei]=1;

이부분에서 

애초에 방문하자마자 

   int s=q.front().first.first;

        int g=q.front().first.second;

        int hei=q.front().second.first;

        int temp=q.front().second.second;

        

        q.pop();

        if(visit[s][g][hei]==1)

            continue;

        cnt=temp;

        ch[s][g][hei]=temp;

        temp++;

       

방문했으면 스킵하는 식으로 바꾸더니 됬습니다.

댓글을 작성하려면 로그인해야 합니다.