# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76040 | tmwilliamlin168 | Tracks in the Snow (BOI13_tracks) | C++14 | 1204 ms | 901464 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int mxN=4e3;
int n, m, ans, nb[4][2]={{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
string g[mxN];
vector<array<int, 2>> tp[2];
__attribute__((always_inline)) bool a(int i, int j) {
return i>=0&&i<n&&j>=0&&j<m&&g[i][j]!='.';
}
void dfs(int i, int j) {
char pc=g[i][j];
g[i][j]='.';
for(int k=0; k<4; ++k) {
int ni=i+nb[k][0], nj=j+nb[k][1];
if(!a(ni, nj))
continue;
if(g[ni][nj]==pc)
dfs(ni, nj);
else
tp[ans&1^1].push_back({ni, nj});
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |