# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
428140 | Maqsut_03 | Paint By Numbers (IOI16_paint) | C++14 | 1 ms | 204 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 <cstdlib>
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
using namespace std;
string ans;
int n, k;
bool used[222222];
std::string solve_puzzle(std::string s, std::vector<int> v)
{
n = s.size(), k = v.size();
int t = 0;
// cout << n << " " << k << "\n";
ll sum = 0;
for (int i=0; i<n; i++) ans += "X";
for (int i=0; i<k; i++) sum += v[i];
sum += k - 1;
int q = n - sum, j =0;
// cout << sum << " " << q << "\n";
for (int i=0; i<k; i++)
{
int j0 = j;
for (int l=j; l<j0 + q; l++)
ans[l] = '?';
j += v[i];
j0 = j;
for (int l=j; l<j0 + q; l++) ans[l] = '?';
j++;
}
if (q == 0)
{
j = 0;
for (int i=0; i<k; i++)
{
ans[j+v[i]] = '_';
j += v[i] + 1;
}
}
return ans;
}
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... |