Submission #275330

#TimeUsernameProblemLanguageResultExecution timeMemory
275330barsboldMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> void play() { bool vis[51][51]; memset(vis , 0 , sizeof(vis)); std::vector<int> f; for(int i =1 ;i<=50; i++){ faceup(i); f[faceup(i)].push_back(i); } for(int i = 1; i<=25; i++){ faceup(f[i][0]); faceup(f[i][1]); } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:10:22: error: request for member 'push_back' in 'f.std::vector<int>::operator[](((std::vector<int>::size_type)faceup(i)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   10 |         f[faceup(i)].push_back(i);
      |                      ^~~~~~~~~
memory.cpp:13:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   13 |     faceup(f[i][0]);
      |                  ^
memory.cpp:14:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   14 |     faceup(f[i][1]);
      |                  ^