# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
209938 | EntityIT | Sandwich (JOI16_sandwich) | C++14 | 2703 ms | 8440 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;
#define all(x) (x).begin(), (x).end()
#define sz(x) ( (int)(x).size() )
using LL = long long;
template<class T>
inline bool asMn(T &a, const T &b) { return a > b ? a = b, true : false; }
template<class T>
inline bool asMx(T &a, const T &b) { return a < b ? a = b, true : false; }
const int inf = 1e9;
mt19937 rng( (uint32_t)chrono::steady_clock::now().time_since_epoch().count() );
int n, m;
vector<vector<int> > a;
bool valid(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; }
array<int, 4> dx{ -1, 0, 1, 0 }, dy{ 0, -1, 0, 1 };
vector<vector<int> > f;
int F(int x, int y, int dir) {
if (!valid(x, y) ) return 0;
if (dir & 1) dir ^= a[x][y];
if (~f[x][y]) return f[x][y] ^ inf ? 0 : inf;
f[x][y] = inf;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |