# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
967552 | amine_aroua | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 352 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.
#pragma once
#include <bits/stdc++.h>
using namespace std;
#define forr(i, x , y) for(int i = x ; i<=y;i++)
#define fore(i , x) for(int i = 0 ; i<x;i++)
#define forn(i , x ,y) for(int i = x; i>=y;i--)
vector<vector<int>> pref;
std::string solve_puzzle(std::string s, std::vector<int> c)
{
int n = (int)s.size();
int K = (int)c.size();
for(auto &C: s)
if(C == '.')C='?';
pref.assign(2 , vector<int>(n + 1 , 0));
forr(i , 1 , n)
{
pref[0][i] = pref[0][i - 1] + (s[i - 1] == '_');
pref[1][i] = pref[1][i - 1] + (s[i - 1] == 'X');
}
vector<vector<int>> dpL(n + 1 , vector<int>(K + 1 , 0)) , dpR(n + 2 , vector<int>(K + 1 , 0));
dpL[0][0] = 1;
forr(i , 1 , n)
{
forr(j , 0 , K) {
if(j - 1 >= 0)
{
int l = i - c[j - 1] + 1;
int r = i;
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... |