Submission #796169

#TimeUsernameProblemLanguageResultExecution timeMemory
796169Minindu206Paint By Numbers (IOI16_paint)C++14
32 / 100
1 ms312 KiB
#include "paint.h" #include<bits/stdc++.h> using namespace std; string solve_puzzle(string s, vector<int> c) { int n = s.size(), len = c.size() - 1; string ss; for(int a:c) len += a; string ans, fst; int i = 0; while(i < n - len + 1) { string temp = string(n, '_'); int cur = i, cnt = 0; while(cnt < (int)c.size()) { for(int j=0;j<c[cnt];j++) temp[cur] = 'X', cur++; cnt++; cur++; } if(i == 0) { ans = temp; fst = temp; } for(int j=0;j<n;j++) if(fst[j] != temp[j]) ans[j] = '?'; i++; } return ans; }
#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...