제출 #607565

#제출 시각아이디문제언어결과실행 시간메모리
607565gonzakia29Paint By Numbers (IOI16_paint)C++17
32 / 100
1 ms292 KiB
#include "paint.h" #include <vector> #include <string> #include <cstdio> #include <cassert> using namespace std; string solve_puzzle(string s, vector<int> c) { string salida = ""; int sizes = s.size(); int k = c.size(); int dif = sizes-(k-1); for (int i = 0; i < k; ++i){ dif -= c[i]; } if (dif != 0){ int counter = 0; for (int i = 0; i < k; ++i){ for (int j = 0; j < c[i]; ++j){ if (j>=dif){ salida += "X"; counter++; } else{ salida += "?"; counter++; } } salida += "?"; counter++; } for (int i = 0; i < sizes-counter;++i){ salida+= "?"; } } else{ for (int i = 0; i < k; ++i){ for (int j = 0; j < c[i]; ++j){ salida += "X"; } if (i != k-1){ salida += "_"; } } } return salida; }
#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...