Submission #1318202

#TimeUsernameProblemLanguageResultExecution timeMemory
1318202hayford08Memory (IOI10_memory)C++20
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> void play() { array<bool, 50> found = {}; for (int i = 1; i <= 50; i++) { if (found[i]) continue; for (int j = i + 1; j <= 50; j++) { char res1 = faceup(i); char res2 = faceup(j); if (res1 == res2) { found[i] = true; found[j] = true; break; } } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:6:4: error: 'array' was not declared in this scope; did you mean 'std::array'?
    6 |    array<bool, 50> found = {};
      |    ^~~~~
      |    std::array
In file included from /usr/include/c++/13/bits/uses_allocator_args.h:38,
                 from /usr/include/c++/13/bits/memory_resource.h:41,
                 from /usr/include/c++/13/string:58,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from memory.cpp:3:
/usr/include/c++/13/tuple:2019:45: note: 'std::array' declared here
 2019 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
memory.cpp:6:10: error: expected primary-expression before 'bool'
    6 |    array<bool, 50> found = {};
      |          ^~~~
memory.cpp:8:11: error: 'found' was not declared in this scope; did you mean 'round'?
    8 |       if (found[i]) continue;
      |           ^~~~~
      |           round
memory.cpp:13:13: error: 'found' was not declared in this scope; did you mean 'round'?
   13 |             found[i] = true;
      |             ^~~~~
      |             round