Submission #940277

#TimeUsernameProblemLanguageResultExecution timeMemory
940277HappyCapybaraMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include<vector> using namespace std; void play() { vector<vector<int>> p(25); for (int i=1; i<=50; i++) p[faceup(i)-1].push_back(i); for (vector<int> v : p){ faceup(p[1]); faceup(p[2]); } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:9:40: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int'
    9 |    for (vector<int> v : p){ faceup(p[1]); faceup(p[2]); }
      |                                        ^
      |                                        |
      |                                        __gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}
In file included from memory.cpp:1:
grader.h:1:17: note:   initializing argument 1 of 'char faceup(int)'
    1 | char faceup(int C);
      |             ~~~~^
memory.cpp:9:54: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int'
    9 |    for (vector<int> v : p){ faceup(p[1]); faceup(p[2]); }
      |                                                      ^
      |                                                      |
      |                                                      __gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}
In file included from memory.cpp:1:
grader.h:1:17: note:   initializing argument 1 of 'char faceup(int)'
    1 | char faceup(int C);
      |             ~~~~^