Submission #92606

#TimeUsernameProblemLanguageResultExecution timeMemory
92606BadralPaint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int a[1000005]; string solve_puzzle(string s, int[] c) { int k = c[0]; for(int i = 0; i < k; i++) a[i]++; for(int i = s.size(); i >= s.size()-k; i--) a[i]++; string sss; for(int i = 0; i < s.size(); i++) { if(a[i] == 2) sss += 'X'; else sss += '?'; } return sss; }

Compilation message (stderr)

paint.cpp:6:37: error: expected ',' or '...' before 'c'
 string solve_puzzle(string s, int[] c) {
                                     ^
paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, int*)':
paint.cpp:7:13: error: 'c' was not declared in this scope
     int k = c[0];
             ^
paint.cpp:9:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = s.size(); i >= s.size()-k; i--) a[i]++;
                           ~~^~~~~~~~~~~~~
paint.cpp:11:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); i++) {
                    ~~^~~~~~~~~~