diff --git "a/khj20006/202512/10 BOJ G5 \352\263\265\354\243\274\353\213\230\354\235\204 \352\265\254\355\225\264\353\235\274!.md" "b/khj20006/202512/10 BOJ G5 \352\263\265\354\243\274\353\213\230\354\235\204 \352\265\254\355\225\264\353\235\274!.md" new file mode 100644 index 00000000..bc9dcfff --- /dev/null +++ "b/khj20006/202512/10 BOJ G5 \352\263\265\354\243\274\353\213\230\354\235\204 \352\265\254\355\225\264\353\235\274!.md" @@ -0,0 +1,44 @@ +```cpp +#include +using namespace std; + +const int dx[4] = {1,0,-1,0}; +const int dy[4] = {0,1,0,-1}; + +int N, M, T; +int arr[100][100]{}; +queue> q; +bool vis[100][100]{}; +int paint = 1234567; + +int main() { + cin.tie(0)->sync_with_stdio(0); + + cin>>N>>M>>T; + for(int i=0;i>arr[i][j]; + + q.emplace(0,0,0); + vis[0][0] = 1; + while(!q.empty()) { + auto [x,y,t] = q.front(); q.pop(); + if(arr[x][y] == 2) { + paint = t + abs(N-x-1) + abs(M-y-1); + } + if(x == N-1 && y == M-1) { + int val = min(paint, t); + if(val > T) cout<<"Fail"; + else cout<=N || yy<0 || yy>=M || vis[xx][yy] || arr[xx][yy] == 1) continue; + vis[xx][yy] = 1; + q.emplace(xx,yy,t+1); + } + } + if(paint > T) cout<<"Fail"; + else cout<