# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570968 | definitelynotmee | Paint By Numbers (IOI16_paint) | C++98 | 405 ms | 163612 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<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
const int INF =(1<<30)-1;
std::string solve_puzzle(std::string s, std::vector<int> c) {
int n = s.size(), k = c.size();
vector<pii> nextblank(n,{-1,n}), nextfull(n,{-INF,INF});
int lastb = -1, lastf = -INF;
for(int i = 0; i < n; i++){
if(s[i] == '_')
lastb = i;
else if(s[i] == 'X')
lastf = i;
nextblank[i].ff = lastb;
nextfull[i].ff = lastf;
}
lastb = n;
lastf = INF;
for(int i = n-1; i >= 0; i--){
if(s[i] == '_')
# | 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... |