Submission #1065667

#TimeUsernameProblemLanguageResultExecution timeMemory
1065667sunboiPaint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "paint.h" using namespace std; string solve_puzzle(string s, int[] c){ int n = s.size(); int k = c.size(); int r = min(c[0] - 1, n - 1); int l = max(0, n - 1 - (c[0] - 1)); for (int i = 0; i< n; i++){ if (i >= l && i <= r){ s[i] = 'X'; }else s[i] = '?'; } return s; }

Compilation message (stderr)

paint.cpp:6:37: error: expected ',' or '...' before 'c'
    6 | string solve_puzzle(string s, int[] c){
      |                                     ^
paint.cpp: In function 'std::string solve_puzzle(std::string, int*)':
paint.cpp:8:13: error: 'c' was not declared in this scope
    8 |     int k = c.size();
      |             ^
paint.cpp:8:9: warning: unused variable 'k' [-Wunused-variable]
    8 |     int k = c.size();
      |         ^