# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
610821 | CoolRabbitXT | Paint By Numbers (IOI16_paint) | C++14 | 1 ms | 308 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 <bits/stdc++.h>
using namespace std;
#include <cstdlib>
int n;
int variacion;
int clue_sum = 0;
int bit_counter = 0;
int bit_count_int;
const int NMAX = 101;
bitset <NMAX>bit_rep;
bitset <NMAX> answer;
string result (NMAX, '?');
bitset <NMAX> original;
std::string solve_puzzle(std::string s, std::vector<int> c) {
n = s.size();
for(int i = 0; i< c.size(); i++){
clue_sum += c[i];
}
variacion = n - (c.size() -1 + clue_sum);
for(int i = 0; i< c.size(); i++){
bit_count_int = bit_counter;
for(int j = bit_count_int; j < c[i] + bit_count_int; j++){
bit_rep.set(NMAX - j -1, 1);
bit_counter ++;
}
if(i != c.size() -1){
bit_counter ++;
}
}
answer = bit_rep;
original = bit_rep;
for(int i = 0; i<variacion; i++){
answer = answer & bit_rep >> 1;
bit_rep >>= 1;
}
for(int i = 0; i<n; i++) result[i] = '?';
for(int i = 0; i< n; i++){
if(answer[NMAX - i -1]) result[i] = 'X';
}
bit_rep = original;
answer = ~bit_rep;
bit_rep = ~bit_rep;
for(int i = 0; i<variacion; i++){
answer = answer & bit_rep >> 1;
bit_rep >>= 1;
}
for(int i = 0; i< n; i++){
if(answer[NMAX - i -1]) result[i] = '_';
}
result.resize(n);
//cout << result << endl;
return result;
}
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... |