# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
868704 | hgmhc | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 2532 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; using ii = pair<int,int>; using ll = long long; using vi = vector<int>;
#define rep(i,a,b) for (auto i = (a); i <= (b); ++i)
#define per(i,a,b) for (auto i = (b); i >= (a); --i)
#define all(x) begin(x), end(x)
#define siz(x) int((x).size())
#define Mup(x,y) x = max(x,y)
#define mup(x,y) x = min(x,y)
#define fi first
#define se second
#define dbg(x) cerr << #x << ": " << (x) << endl
const int N = 5005, K = 105;
int n, k;
char S[N]; int C[N];
int cX[N], c_[N];
bool pfx[N][K], sfx[N][K];
int ctr[N][K];
void calc_fx(bool fx[N][K]) {
// fx[i][j] := 1..i에서 앞선 j개의 블록 포함되게 가능 여부
fx[0][0] = true;
rep(i,1,n+1) {
rep(j,0,k) {
if (S[i] != 'X') fx[i][j] |= fx[i-1][j];
if (i-C[j] == 0 && j == 1) {
if (c_[C[j]] == 0) {
fx[i][j] = true;
}
# | 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... |