제출 #615684

#제출 시각아이디문제언어결과실행 시간메모리
615684HanksburgerNautilus (BOI19_nautilus)C++17
100 / 100
219 ms852 KiB
#include <bits/stdc++.h> using namespace std; bitset<255025> a, b; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m, q; cin >> n >> m >> q; for (int i=0; i<n; i++) { for (int j=0; j<m; j++) { char x; cin >> x; a[i*505+j]=b[i*505+j]=x=='.'; } } for (int i=0; i<q; i++) { char x; cin >> x; if (x=='E') b<<=1; else if (x=='W') b>>=1; else if (x=='S') b<<=505; else if (x=='N') b>>=505; else b=(b<<1)|(b>>1)|(b<<505)|(b>>505); b&=a; } cout << b.count(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...