# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40349 | krauch | Watching (JOI13_watching) | C++14 | 172 ms | 9192 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;
typedef long long ll;
typedef pair < int, int > PII;
#define F first
#define S second
#define mkp make_pair
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define forn(x, a, b) for (int x = a; x <= b; ++x)
#define for1(x, a, b) for (int x = a; x >= b; --x)
const ll ool = 1e18 + 9;
const int N = 3e3 + 3, oo = 1e9 + 9;
int n, P, Q, a[N], d[N][N];
bool check(int W) {
int ptr = 1;
forn(i, 0, P) forn(j, 0, Q) d[i][j] = 1;
forn(i, 0, P) {
forn(j, 0, Q) {
if (d[i][j] == -1) continue;
int ptr = d[i][j];
while (ptr <= n && a[ptr] - a[d[i][j]] + 1 <= W) {
++ptr;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |