Submission #433104

#TimeUsernameProblemLanguageResultExecution timeMemory
433104MonchitoPaint By Numbers (IOI16_paint)C++14
Compilation error
0 ms0 KiB
#include "paint.h" #include <cstdlib> using namespace std; string solve_puzzle(string s, vector<int> c) { int n = (int)s.size(); int k = (int)c.size(); string ret=""; for(int i=0; i<n; i++) ret += "?"; int current=0; for(int i=0; i<k; i++) { for(int j=current; j<current+c[i]; j++) { ret[j] = 'X'; } if(current+c[i] < n) ret[current+c[i]] = '_'; current += c[i]+1; } int l=0; for(int i=current; i<n; i++) { ret[l] = '?'; l++; }

Compilation message (stderr)

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:29:5: error: expected '}' at end of input
   29 |     }
      |     ^
paint.cpp:5:46: note: to match this '{'
    5 | string solve_puzzle(string s, vector<int> c) {
      |                                              ^
paint.cpp:29:5: warning: no return statement in function returning non-void [-Wreturn-type]
   29 |     }
      |     ^