Submission #209349

#TimeUsernameProblemLanguageResultExecution timeMemory
209349DavidDamianPaint By Numbers (IOI16_paint)C++11
32 / 100
5 ms380 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; struct range { int L,R; }; string solve_puzzle(string s, vector<int> clues) { int k=clues.size(); vector<range> ranges(k+1); string ans=s; int act=0; for(int i=0;i<k;i++){ ranges[i].L=act; act+=clues[i]+1; } act=0; int n=s.size(); for(int i=k-1;i>=0;i--){ ranges[i].R=n-act; ranges[i].R--; act+=clues[i]+1; } for(int i=0;i<k;i++){ int m=ranges[i].R-ranges[i].L+1; //cout<<ranges[i].L<<" "<<ranges[i].R<<endl; for(int j=0;j<m;j++){ int id=ranges[i].L+j; if(j>m-clues[i]-1 && j<clues[i]) ans[id]='X'; else ans[id]='?'; } } for(int i=0;i<n;i++){ if(ans[i]=='.') ans[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...