Submission #103617

#TimeUsernameProblemLanguageResultExecution timeMemory
103617turbatCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" void exploreCave(int N) { int a[N], s[N], d[N], ans[N], found[N],l, r, t; memset(s, 0, sizeof s); d = s; for (int i = 0;i < N;i++) for (int i = 0;i < N;i++){ a = s; if (tryCombination(a) > i) t = 0; else t = 1; l = 0, r = n - 1; while (l != r){ a = s; int mid = 0; for (int i = l;i <= mid;i++) if (!found[i]) a[i] = t; if (tryCombination(a) > i) r = mid; else l = mid + 1; } d[l] = i; found[l] = 1; s[l] = t; } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:6: error: invalid array assignment
  d = s;
      ^
cave.cpp:11:7: error: invalid array assignment
   a = s;
       ^
cave.cpp:14:14: error: 'n' was not declared in this scope
   l = 0, r = n - 1;
              ^
cave.cpp:16:8: error: invalid array assignment
    a = s;
        ^
cave.cpp:6:24: warning: unused variable 'ans' [-Wunused-variable]
  int a[N], s[N], d[N], ans[N], found[N],l, r, t;
                        ^~~