# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92605 | Badral | Paint By Numbers (IOI16_paint) | C++17 | 0 ms | 0 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;
int a[1000005];
int main() {
string str, s;
getline(cin, str);
int i;
for(i = 14; i < (int)str.size(); i++) {
if(str[i] != '"') s += str[i];
else break;
}
i += 2;
vector<int> v;
for(; i < (int)str.size(); i++) {
int k = 0;
while(str[i] <= '9' && str[i] >= '0') {
k = k * 10 + str[i] - 48;
i++;
}
if(k != 0) v.push_back(k);
}
int k = v[0];
for(int i = 0; i < k; i++) {
a[i]++;
}
for(int i = (int)s.size(); i >= (int)s.size()-k; i--) {
a[i]++;
}
for(int i = 0; i < (int)s.size(); i++) {
if(a[i] == 2) {
cout<<'X';
}
else cout<<'?';
}
}