# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
414708 | juggernaut | Nautilus (BOI19_nautilus) | C++17 | 569 ms | 1220 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
typedef long long ll;
#define USING_ORDERED_SET 0
#if USING_ORDERED_SET
#include<bits/extc++.h>
using namespace __gnu_pbds;
template<class T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#endif
template<class T>void umax(T &a,T b){if(a<b)a=b;}
template<class T>void umin(T &a,T b){if(b<a)a=b;}
#ifdef IOI2021SG
#define printl(args...)printf(args)
#else
#define printl(args...)((void)0)
#endif
int n,m,q;
const int N=505;
int main(){
#ifndef IOI2021SG
ios_base::sync_with_stdio(false);
cin.tie(0);
#endif
cin>>n>>m>>q;
bitset<2*N*N>valid,dp;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++){
char ch;
cin>>ch;
if(ch=='.')valid.set(i*N+j,1);
}
dp=valid;
for(int i=1;i<=q;i++){
char ch;
cin>>ch;
if(ch=='N')dp>>=N;
else if(ch=='S')dp<<=N;
else if(ch=='W')dp>>=1;
else if(ch=='E')dp<<=1;
else dp=((dp<<N)|(dp>>1)|(dp<<1)|(dp>>N));
dp&=valid;
}
cout<<dp.count();
}
/*
5 9 7
...##....
..#.##..#
..#....##
.##...#..
....#....
WS?EE??
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |