# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
729797 | 2023-04-24T15:11:37 Z | vjudge1 | Nautilus (BOI19_nautilus) | C++14 | 8 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int r,c,mx; string m; cin>>r>>c>>mx; char mat[r][c]; for(int i=0;i<r;i++) { for(int j=0;j<c;j++) { cin>>mat[i][j]; } } cin>>m; int ans=0; queue<int>Q; for(int i=0;i<r;i++) { for(int j=0;j<c;j++) { if(mat[i][j]=='.')///""; { Q.push(i); Q.push(j); Q.push(0); while(!Q.empty()) { int ti=Q.front();Q.pop(); int tj=Q.front();Q.pop(); int k=Q.front();Q.pop(); if(k==m.size()) { ans++; } else { if(m[k]=='?') { } else { int ci=ti; int cj=tj; if(m[k]=='N') { ci--; } else if(m[k]=='S') { ci++; } else if(m[k]=='W') { cj--; } else { cj++; } if(ci<0||cj<0||ci>=r||cj>=c)continue; if(mat[ci][cj]=='#')continue; Q.push(ci); Q.push(cj); Q.push(k+1); } } } while(!Q.empty()) { Q.pop(); } } } } cout<<ans<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 232 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 232 KB | Output is correct |
7 | Incorrect | 1 ms | 328 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 232 KB | Output is correct |
7 | Incorrect | 1 ms | 328 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |