Submission #609387

#TimeUsernameProblemLanguageResultExecution timeMemory
609387Mohammed_AtalahPaint By Numbers (IOI16_paint)C++17
0 / 100
0 ms212 KiB
#include "paint.h" #include <cstdlib> #include <bits/stdc++.h> using namespace std; std::string solve_puzzle(std::string s, std::vector<int> c) { string result = ""; int total = 0; int sz = s.size(); for (auto &i : c) { total += i; } total += c.size() - 1; int e = sz - total; int sz2 = c.size(); if (e == 0) { for (int i = 0; i < sz2; i++) { for (int j = 0 ; j < c[i]; j++) { result += 'X'; } if (i < sz2 - 1) { result += '_'; } } return result; } cout << e << endl; for (int i = 0; i < sz2; i++) { for (int j = 0 ; j < min(c[i], e); j++) { result += '?'; } if (c[i] > e) { for (int j = 0 ; j < c[i] - e; j++) { result += 'X'; } } if (i < sz2 - 1) result += '?'; } for (int i = result.size(); i < sz; i++) { result += '?'; } return result; }
#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...