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 <bits/stdc++.h>
using namespace std;
std::string solve_puzzle(std::string s, std::vector<int> c) {
int posi = s.size() - c[0] + 1;
int tam = s.size();
string a[posi];
for(int i = 0 ; i < posi; i++){
for(int j = 0 ; j < tam; j++){
a[i] += '.';
}
}
int it = 0;
int pos;
for(int i = 0 ; i < posi; i++){
pos = 0;
int from = pos, to = it;
for(int j = from; j < to; j++){
a[i][j] = '_';
pos++;
}
it++;
from = pos; to = pos+c[0] - 1;
for(int j = from; j < to + 1; j++){
a[i][j] = 'X';
pos++;
}
from = pos; to = s.size();
for(int j = pos; j < to; j++){
a[i][j] = '_';
pos++;
}
}
int cont;
string ans;
for(int i = 0 ; i < tam; i++){
cont = 0;
for(int j = 0 ; j < posi; j++){
if(a[j][i] == 'X'){
cont++;
}
}
if(cont == posi){
ans += 'X';
}else{
ans += '?';
}
}
return ans;
}
# | 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... |