Submission #432782

#TimeUsernameProblemLanguageResultExecution timeMemory
432782zxcvbnmPaint By Numbers (IOI16_paint)C++14
0 / 100
0 ms204 KiB
#include "paint.h"

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

std::string solve_puzzle(std::string s, std::vector<int> c) {
    int n = s.length();
    int k = c.size();
    int sum = accumulate(c.begin(), c.end(), 0);
    if (sum+(k-1) == n) {
        string ans;
        for(int i = 0; i < k; i++) {
            if (i != 0) {
                ans += '_';
            }
            for(int j = 0; j < c[i]; j++) {
                ans += 'X';
            }
        }
        return ans;
    } else {
        return string(n, '?');
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...