Submission #607563

#TimeUsernameProblemLanguageResultExecution timeMemory
607563gonzakia29Paint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include "paint.h" #include <vector> #include <string> #include <cstdio> #include <cassert> const int S_MAX_LEN = 200 * 1000; char buf[S_MAX_LEN + 1]; 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; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccZZHIKd.o:(.bss+0x0): multiple definition of `buf'; /tmp/ccuVtdYf.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status