# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
216076 | MKopchev | Nautilus (BOI19_nautilus) | C++14 | 359 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int nmax=500+5;
int n,m,k;
bitset<nmax> can[nmax],current[nmax],help[nmax],idle;
int main()
{
scanf("%i%i%i",&n,&m,&k);
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
{
char c=getchar();
while(c!='.'&&c!='#')c=getchar();
if(c=='.')can[i][j]=1;
}
for(int i=1;i<=n;i++)
current[i]=can[i];
for(int i=1;i<=k;i++)
{
char c=getchar();
while(c!='W'&&c!='E'&&c!='S'&&c!='N'&&c!='?')c=getchar();
for(int p=1;p<=n;p++)
help[p]=idle;
if(c=='N'||c=='?')
{
for(int p=1;p<=n;p++)
help[p]=help[p]|current[p+1];
}
if(c=='S'||c=='?')
{
for(int p=1;p<=n;p++)
help[p]=help[p]|current[p-1];
}
if(c=='E'||c=='?')
{
for(int p=1;p<=n;p++)
help[p]=help[p]|(current[p]<<1);
}
if(c=='W'||c=='?')
{
for(int p=1;p<=n;p++)
help[p]=help[p]|(current[p]>>1);
}
for(int p=1;p<=n;p++)
current[p]=help[p]&can[p];
/*
int output=0;
for(int p=1;p<=n;p++)
output=output+current[p].count();
printf("%i\n",output);
cout<<"current "<<endl;
for(int p=1;p<=n;p++)
{
for(int q=1;q<=m;q++)cout<<current[p][q]<<" ";
cout<<endl;
}
cout<<"help "<<endl;
for(int p=1;p<=n;p++)
{
for(int q=1;q<=m;q++)cout<<help[p][q]<<" ";
cout<<endl;
}
cout<<"---"<<endl;
*/
}
int output=0;
for(int p=1;p<=n;p++)
output=output+current[p].count();
printf("%i\n",output);
return 0;
}
컴파일 시 표준 에러 (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... |