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 <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
string solve_puzzle(string s,vector<int> c)
{
int n=s.size();
string ans="";
int k=c[0];
set<char> pos[n];
for(int i=0;(i+k-1)<n;i++)
{
string cur(n,'_');
for(int j=0;j<k;j++)
cur[i+j]='X';
for(int j=0;j<n;j++)
pos[j].insert(cur[j]);
}
for(int i=0;i<n;i++)
{
// cout<<pos[j].sie()/<<endl;
if(pos[i].size()==2)
{
ans+='?';
}
else
{
ans+=(*begin(pos[i]));
}
}
return ans;
// for(int i=0;i<k;i++)
// {
// }
return ans;
}
# | 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... |