| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 679419 | vjudge1 | Nautilus (BOI19_nautilus) | C++17 | 162 ms | 716 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define ed '\n'
#define pb push_back
#define ii pair<int,int>
#define o_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define fi first
#define se second
using namespace __gnu_pbds;
using namespace std;
bitset<502> d[502], d2[502];
int n, m, k;
inline void Do(char c) {
bitset<502> tmp[502];
//for(int i = 1; i <= n; ++i) tmp[i] = d[i];
for(int i = 1; i <= n; ++i) {
if (c == 'W' || c == '?') tmp[i] |= (d[i] >> 1);
if (c == 'E' || c == '?') tmp[i] |= (d[i] << 1);
if (c == 'N' || c == '?') tmp[i - 1] |= d[i];
if (c == 'S' || c == '?') tmp[i + 1] |= d[i];
}
for(int i = 1; i <= n; ++i) {
d[i] = tmp[i] & d2[i];
}
}
void solve() {
cin >> n >> m >> k;
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= m; ++j) {
char c;
cin >> c;
if (c == '.') d[i].set(j), d2[i].set(j);
}
}
string s;
cin >> s;
for(int i = 0; i < k; ++i) {
Do(s[i]);
// return;
}
int ans = 0;
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= m; ++j) {
ans += d[i][j];
}
}
cout << ans << ed;
//cout << ans;
}
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
if (fopen("cf.inp", "r")) {
freopen("cf.inp", "r", stdin);
//freopen("cf.inp", "w", stdout);
}
solve();
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... | ||||
