# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117103 | Meloric | Paint By Numbers (IOI16_paint) | C++14 | 1046 ms | 105736 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 <iostream>
#include <cstdlib>
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
vector<vector<int>> mem;
vector<int> whi;
vector<pii> ans;
int n, k;
int dp(int i, int j, string &s, vector<int>& c){
if(i >= n && j == k)return 1;
if(i >= n)return 0;
if(j==k && s[i] == 'X')return 0;
if(mem[i][j]!=-1)return mem[i][j];
int val = 0;
if(s[i]!='X'){
if(dp(i+1, j, s, c)){
ans[i].X = 1;
val = 1;
//cout << i << ' '<<j <<'i'<<'\n';
}
}
if(j != k && i+c[j] < whi.size() && whi[i+c[j]]-whi[i] == 0){
if(i+c[j] == s.size() || s[i+c[j]] != 'X'){
if(dp(i+c[j]+1, j+1, s, c)){
ans[i+c[j]].X = 1;
Compilation message (stderr)
# | 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... |