Submission #92235

#TimeUsernameProblemLanguageResultExecution timeMemory
92235turbatPaint By Numbers (IOI16_paint)C++14
0 / 100
2 ms376 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; #define N 200005 int dp[N], cnt[N], n, t, ok, now; string st, st1, ans; string solve_puzzle(string s, vector<int> c) { n = s.size(); t = c.size(); now = 0; for (int i = 0;i < n;i++){ if (t == now){ st += '_'; continue; } ok = 0; for (int j = 0;j < c[now];j++) if (s[i + j] == '_') ok = 1; if (!ok) st += 'X', now++; else st = '_'; } reverse(s.begin(), s.end()); reverse(c.begin(), c.end()); now = 0; for (int i = 0;i < n;i++){ if (t == now){ st1 += '_'; continue; } ok = 0; for (int j = 0;j < c[now];j++) if (s[i + j] == '_') ok = 1; if (!ok) st1 += 'X', now++; else st1 = '_'; } reverse(st1.begin(), st1.end()); for (int i = 0;i < n;i++) if (st[i] == st1[i]) ans += st[i]; else ans += '?'; 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...