# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
366953 | vishesh312 | Tracks in the Snow (BOI13_tracks) | C++17 | 1148 ms | 984844 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;
/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
*/
#define all(x) begin(x), end(x)
#define sz(x) (int)x.size()
using ll = long long;
const int mod = 1e9+7;
vector<string> v;
int n, m;
int ans = 0;
array<vector<array<int, 2>>, 2> cur;
bool isValid(int i, int j) {
return i < n and i >= 0 and j < m and j >= 0 and v[i][j] != '.';
}
vector<array<int, 2>> moves = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
void dfs(array<int, 2> a) {
char c = v[a[0]][a[1]];
v[a[0]][a[1]] = '.';
for (auto m : moves) {
int nx = a[0] + m[0], ny = a[1] + m[1];
if (isValid(nx, ny)) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |