Submission #1076151

#TimeUsernameProblemLanguageResultExecution timeMemory
1076151asdasdqwerPaint By Numbers (IOI16_paint)C++14
32 / 100
1 ms444 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; std::string solve_puzzle(std::string s, std::vector<int> c) { bitset<200> bt; int pt =0; for (auto &x:c) { for (int i=0;i<x;i++) bt[pt++]=1; pt++; } int n=(int)s.size(); for (int i=0;i<=(n-pt);i++) { bt &= bt << 1; } string out; for (int i=0;i<n;i++) { if (bt[i] == 0) out += "?"; else out += "X"; } if (out.back() == 'X') { for (auto &x:out) if (x == '?') x='_'; } return out; }
#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...