# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
426388 | SuhaibSawalha1 | Paint By Numbers (IOI16_paint) | C++17 | 874 ms | 94576 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 "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5, M = 100;
int canb[3 * N], canw[3 * N], dp[N][M], n, m, cnt[N];
vector<int> c;
string s;
bool calc (int i = 0, int j = 0) {
if (i >= n) {
return j == m;
}
int &ret = dp[i][j];
if (~ret) {
return ret;
}
ret = 0;
if (s[i] != 'X' && calc(i + 1, j)) {
canw[i] = ret = 1;
}
if (j != m && cnt[i] >= c[j] && s[i] != '_' && (i + c[j] >= n || s[i + c[j]] != 'X') && calc(i + c[j] + 1, j + 1)) {
ret = 1;
++canb[i];
--canb[i + c[j]];
canw[i + c[j]] = 1;
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |