Submission #47844

# Submission time Handle Problem Language Result Execution time Memory
47844 2018-05-08T06:32:47 Z mirbek01 Library (JOI18_library) C++17
Compilation error
0 ms 0 KB
library
#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;

void Solve(int N){
      vector <int> res(N), M(N), used(N), a(N), b(N);

      int cur = 0, p1 = 0;
      a[0] = 0;
      b[0] = 0;
      used[0] = 1;

      while(1){
            int cn = 0;
            for(int i = 0; i < N; i ++){
                  if(used[i]) continue;
                  M[cur] = 1;
                  M[i] = 1;
                  int re = Query(M);
                  M[cur] = 0;
                  M[i] = 0;
                  if(re == 1){
                        cn ++;
                        used[i] = 1;
                        a[++ p1] = i;
                        cur = i;
                        break;
                  }
            }
            if(!cn) break;
      }
      cur = 0;
      int p2 = 0;
      while(1){
            int cn = 0;
            for(int i = 0; i < N; i ++){
                  if(used[i]) continue;
                  M[cur] = 1;
                  M[i] = 1;
                  int re = Query(M);
                  M[cur] = 0;
                  M[i] = 0;
                  if(re == 1){
                    	cn ++;
                        used[i] = 1;
                        b[++ p2] = i;
                        cur = i;
                        break;
                  }
            }
            if(!cn) break;
      }
      int ps = 0;
      for(int i = p2; i > 0; i --){
            res[ps ++] = b[i] + 1;
      }
      for(int i = 0; i <= p1; i ++){
            res[ps ++] = a[i] + 1;
      }

	Answer(res);
}

Compilation message

library.cpp:1:1: error: 'library' does not name a type
 library
 ^~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:62:0,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of symbol
   __is_null_pointer(std::nullptr_t)
                                   ^
/usr/include/c++/7/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)'
     __is_null_pointer(_Type)
     ^~~~~~~~~~~~~~~~~
/usr/include/c++/7/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std'
   __is_null_pointer(std::nullptr_t)
                          ^~~~~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:362:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:363:25: error: '_Size' was not declared in this scope
     struct is_array<_Tp[_Size]>
                         ^~~~~
/usr/include/c++/7/type_traits:363:31: error: template argument 1 is invalid
     struct is_array<_Tp[_Size]>
                               ^
/usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std'
     struct __is_null_pointer_helper<std::nullptr_t>
                                          ^~~~~~~~~
/usr/include/c++/7/type_traits:561:51: error: template argument 1 is invalid
     struct __is_null_pointer_helper<std::nullptr_t>
                                                   ^
/usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1464:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1464:61: error: template argument 1 is invalid
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                                             ^
/usr/include/c++/7/type_traits:1464:61: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1469:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1469:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/7/type_traits:1469:46: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1471:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:1472:21: error: '_Size' was not declared in this scope
     struct rank<_Tp[_Size]>
                     ^~~~~
/usr/include/c++/7/type_traits:1472:27: error: template argument 1 is invalid
     struct rank<_Tp[_Size]>
                           ^
/usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1473:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1473:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/7/type_traits:1473:65: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1477:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1477:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1477:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/7/type_traits:1477:65: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1482:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1482:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1482:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/7/type_traits:1482:46: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1484:42: error: 'std::size_t' has not been declared
   template<typename _Tp, unsigned _Uint, std::size_t _Size>
                                          ^~~
/usr/include/c++/7/type_traits:1485:23: error: '_Size' was not declared in this scope
     struct extent<_Tp[_Size], _Uint>
                       ^~~~~
/usr/include/c++/7/type_traits:1485:36: error: template argument 1 is invalid
     struct extent<_Tp[_Size], _Uint>
                                    ^
/usr/include/c++/7/type_traits:1486:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                     ^~~~~~
/usr/include/c++/7/type_traits:1486:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1487:24: error: '_Size' was not declared in this scope
           _Uint == 0 ? _Size : extent<_Tp,
                        ^~~~~
/usr/include/c++/7/type_traits:1488:28: error: template argument 1 is invalid
           _Uint - 1>::value>
                            ^
/usr/include/c++/7/type_traits:1488:28: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1493:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                     ^~~~~~
/usr/include/c++/7/type_traits:1493:37: note: suggested alternative:
In file included from /usr/include/stdio.h:33:0,
                 from /usr/include/c++/7/cstdio:42,
                 from library.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/type_traits:1495:31: error: template argument 1 is invalid
              _Uint - 1>::value>
                               ^
/usr/include/c++/7/type_traits:1495:31: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1944:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:1945:30: error: '_Size' was not declared in this scope
     struct remove_extent<_Tp[_Size]>
                              ^~~~~
/usr/include/c++/7/type_traits:1945:36: error: template argument 1 is invalid
     struct remove_extent<_Tp[_Size]>
                                    ^
/usr/include/c++/7/type_traits:1957:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:1958:35: error: '_Size' was not declared in this scope
     struct remove_all_extents<_Tp[_Size]>
                                   ^~~~~
/usr/include/c++/7/type_traits:1958:41: error: template argument 1 is invalid
     struct remove_all_extents<_Tp[_Size]>
                                         ^
/usr/include/c++/7/type_traits:2016:12: error: 'std::size_t' has not been declared
   template<std::size_t _Len>
            ^~~
/usr/include/c++/7/type_traits:2021:23: error: '_Len' was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/7/type_traits:2036:12: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
            ^~~
/usr/include/c++/7/type_traits:2036:30: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
                              ^~~
/usr/include/c++/7/type_traits:2037:48: error: '_Len' was not declared in this scope
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                ^~~~
/usr/include/c++/7/type_traits:2037:52: error: template argument 1 is invalid
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                    ^
/usr/include/c++/7/type_traits:2042:23: error: '_Len' was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/7/type_traits:2043:37: error: '_Align' was not declared in this scope
  struct __attribute__((__aligned__((_Align)))) { } __align;
                                     ^~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/bits/stl_pair.h:86:12: error: 'std::size_t' has not been declared
   template<std::size_t...>
            ^~~
/usr/include/c++/7/bits/stl_pair.h:429:36: error: 'std::size_t' has not been declared
       template<typename... _Args1, std::size_t... _Indexes1,
                                    ^~~
/usr/include/c++/7/bits/stl_pair.h:430:36: error: 'std::size_t' has not been declared
                typename... _Args2, std::size_t... _Indexes2>
                                    ^~~
/usr/include/c++/7/bits/stl_pair.h:432:27: error: '_Indexes1' was not declared in this scope
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                           ^~~~~~~~~
/usr/include/c++/7/bits/stl_pair.h:432:27: note: suggested alternative: '_Index_tuple'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                           ^~~~~~~~~
                           _Index_tuple
/usr/include/c++/7/bits/stl_pair.h:432:36: error: expected parameter pack before '...'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                    ^~~
/usr/include/c++/7/bits/stl_pair.h:432:39: error: template argument 1 is invalid
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                       ^
/usr/include/c++/7/bits/stl_pair.h:432:55: error: '_Indexes2' was not declared in this scope
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                       ^~~~~~~~~
/usr/include/c++/7/bits/stl_pair.h:432:55: note: suggested alternative: '_Index_tuple'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                       ^~~~~~~~~
                                                       _Index_tuple
/usr/include/c++/7/bits/stl_pair.h:432:64: error: expected parameter pack before '...'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                                ^~~
/usr/include/c++/7/bits/stl_pair.h:432:67: error: template argument 1 is invalid
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                                   ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/bits/stl_iterator_base_types.h:116:67: error: 'ptrdiff_t' does not name a type
   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
                                                                   ^~~~~~~~~
/usr/include/c++/7/bits/stl_iterator_base_types.h:182:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t                   difference_type;
               ^~~~~~~~~
/usr/include/c++/7/bits/stl_iterator_base_types.h:193:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t                   difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:110:5: error: 'ptrdiff_t' does not name a type
     ptrdiff_t
     ^~~~~~~~~
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:116:5: error: 'ptrdiff_t' does not name a type
     ptrdiff_t
     ^~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_iterator.h:66:0,
                 from /usr/include/c++/7/bits/stl_algobase.h:67,
                 from /usr/include/c++/7/vector:60,
                 from library.cpp:3:
/usr/include/c++/7/bits/ptr_traits.h:104:20: error: 'ptrdiff_t' was not declared in this scope
  = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
                    ^~~~~~~~~
/usr/include/c++/7/bits/ptr_traits.h:104:54: error: template argument 1 is invalid
  = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
                                                      ^
/usr/include/c++/7/bits/ptr_traits.h:130:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/7/vector:60:0,
                 from library.cpp:3:
/usr/include/c++/7/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*)':
/usr/include/c++/7/bits/stl_algobase.h:366:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^~~~~~~~~
/usr/include/c++/7/bits/stl_algobase.h:367:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^~~~
/usr/include/c++/7/bits/stl_algobase.h:367:8: note: suggested alternative: '_NEW'
    if (_Num)
        ^~~~
        _NEW
/usr/include/c++/7/bits/stl_algobase.h:369:22: error: '_Num' was not declared in this scope
    return __result + _Num;
                      ^~~~
/usr/include/c++/7/bits/stl_algobase.h:369:22: note: suggested alternative: '_NEW'
    return __result + _Num;
                      ^~~~
                      _NEW
/usr/include/c++/7/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*)':
/usr/include/c++/7/bits/stl_algobase.h:568:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^~~~~~~~~
/usr/include/c++/7/bits/stl_algobase.h:569:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^~~~
/usr/include/c++/7/bits/stl_algobase.h:569:8: note: suggested alternative: '_NEW'
    if (_Num)
        ^~~~
        _NEW
/usr/include/c++/7/bits/stl_algobase.h:571:22: error: '_Num' was not declared in this scope
    return __result - _Num;
                      ^~~~
/usr/include/c++/7/bits/stl_algobase.h:571:22: note: suggested alternative: '_NEW'
    return __result - _Num;
                      ^~~~
                      _NEW
In file included from /usr/include/c++/7/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/vector:61,
                 from library.cpp:3:
/usr/include/c++/7/new: At global scope:
/usr/include/c++/7/new:120:31: error: declaration of '