Submission #42229

#TimeUsernameProblemLanguageResultExecution timeMemory
42229yusufakeTeams (IOI15_teams)C++98
Compilation error
0 ms0 KiB
yusufk /* ID: ekrem LANG: C++ TASK: teams */ #include <algorithm> #include <iostream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <cstdio> #include <string> #include <vector> #include <cmath> #include <ctime> #include <queue> #include <stack> #include <map> #include <set> // #include "teams.h" using namespace std; #define foreach(kk,gg) for(__typeof(gg.begin())kk=gg.begin();kk!=gg.end();kk++) #define dbgs(x) cerr << (#x) << " --> " << (x) << ' ' #define dbg(x) cerr << (#x) << " --> " << (x) << endl #define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++) #define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--) #define SET(a, b) memset(a, b, sizeof a) #define heap priority_queue #define orta (bas+son>>1) #define endll puts("") #define mp make_pair #define pb push_back #define sag (k+k+1) #define sol (k+k) #define endl '\n' #define nd second #define st first #define y1 ekrem #define y2 merke typedef int don; #define int long long int inline don read(){don x;scanf(" %d",&x);return x;} typedef pair < int , int > ii; typedef vector < int > vi; typedef vector < ii > vii; const int inf = 1e9 + 7; const int linf = 1e18 + 7; const int NMAX = 5e5 + 5; don N, A[NMAX], B[NMAX], Q, M, K[NMAX]; int n, h[NMAX]; vi g[NMAX]; multiset < int > s; don can(don M, don K[]){ SET(h, 0); FOR(i, 0, M - 1) h[K[i]] += K[i]; s.clear(); FOR(i, 1, n){ foreach(k, g[i]) s.insert(*k); if(h[i]){ int say = h[i]; while(say and !s.empty()){ s.erase(s.begin()); say--; } if(say) return 0; } while(s.count(i)) s.erase(i); } return 1; } void init(don N, don A[], don B[]){ n = N; FOR(i, 0, N - 1) g[A[i]].pb(B[i]); }

Compilation message (stderr)

teams.cpp:2:1: error: 'yusufk' does not name a type
 yusufk
 ^
In file included from /usr/include/c++/5/bits/stl_pair.h:59:0,
                 from /usr/include/c++/5/utility:70,
                 from /usr/include/c++/5/algorithm:60,
                 from teams.cpp:8:
/usr/include/c++/5/bits/move.h:193:26: error: 'size_t' has not been declared
   template<typename _Tp, size_t _Nm>
                          ^
/usr/include/c++/5/bits/move.h: In function 'void std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])':
/usr/include/c++/5/bits/move.h:200:12: error: 'size_t' was not declared in this scope
       for (size_t __n = 0; __n < _Nm; ++__n)
            ^
/usr/include/c++/5/bits/move.h:200:28: error: '__n' was not declared in this scope
       for (size_t __n = 0; __n < _Nm; ++__n)
                            ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/5/algorithm:61,
                 from teams.cpp:8:
/usr/include/c++/5/bits/stl_iterator_base_types.h: At global scope:
/usr/include/c++/5/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++/5/bits/stl_iterator_base_types.h:182:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t                   difference_type;
               ^
/usr/include/c++/5/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++/5/algorithm:61:0,
                 from teams.cpp:8:
/usr/include/c++/5/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++/5/bits/stl_algobase.h:382:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^
/usr/include/c++/5/bits/stl_algobase.h:383:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^
/usr/include/c++/5/bits/stl_algobase.h:385:22: error: '_Num' was not declared in this scope
    return __result + _Num;
                      ^
/usr/include/c++/5/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++/5/bits/stl_algobase.h:584:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^
/usr/include/c++/5/bits/stl_algobase.h:585:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^
/usr/include/c++/5/bits/stl_algobase.h:587:22: error: '_Num' was not declared in this scope
    return __result - _Num;
                      ^
/usr/include/c++/5/bits/stl_algobase.h: In function 'typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a(_Tp*, _Tp*, const _Tp&)':
/usr/include/c++/5/bits/stl_algobase.h:722:11: error: expected primary-expression before 'const'
       if (const size_t __len = __last - __first)
           ^
/usr/include/c++/5/bits/stl_algobase.h:722:11: error: expected ')' before 'const'
/usr/include/c++/5/bits/stl_algobase.h:723:63: error: '__len' was not declared in this scope
  __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
                                                               ^
/usr/include/c++/5/bits/stl_algobase.h: In static member function 'static bool std::__equal<true>::equal(const _Tp*, const _Tp*, const _Tp*)':
/usr/include/c++/5/bits/stl_algobase.h:829:8: error: expected primary-expression before 'const'
    if (const size_t __len = (__last1 - __first1))
        ^
/usr/include/c++/5/bits/stl_algobase.h:829:8: error: expected ')' before 'const'
/usr/include/c++/5/bits/stl_algobase.h:830:65: error: '__len' was not declared in this scope
      return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) * __len);
                                                                 ^
/usr/include/c++/5/bits/stl_algobase.h: In static member function 'static bool std::__lexicographical_compare<true>::__lc(const _Tp*, const _Tp*, const _Up*, const _Up*)':
/usr/include/c++/5/bits/stl_algobase.h:933:10: error: 'size_t' does not name a type
    const size_t __len1 = __last1 - __first1;
          ^
/usr/include/c++/5/bits/stl_algobase.h:934:10: error: 'size_t' does not name a type
    const size_t __len2 = __last2 - __first2;
          ^
/usr/include/c++/5/bits/stl_algobase.h:935:8: error: expected primary-expression before 'const'
    if (const size_t __len = std::min(__len1, __len2))
        ^
/usr/include/c++/5/bits/stl_algobase.h:935:8: error: expected ')' before 'const'
/usr/include/c++/5/bits/stl_algobase.h:936:62: error: '__len' was not declared in this scope
      if (int __result = __builtin_memcmp(__first1, __first2, __len))
                                                              ^
/usr/include/c++/5/bits/stl_algobase.h:938:11: error: '__len1' was not declared in this scope
    return __len1 < __len2;
           ^
/usr/include/c++/5/bits/stl_algobase.h:938:20: error: '__len2' was not declared in this scope
    return __len1 < __len2;
                    ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new: At global scope:
/usr/include/c++/5/new:111:31: error: declaration of 'operator new' as non-function
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                               ^
/usr/include/c++/5/new:111:20: error: 'size_t' is not a member of 'std'
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                    ^
/usr/include/c++/5/new:111:20: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:113:33: error: declaration of 'operator new []' as non-function
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                                 ^
/usr/include/c++/5/new:113:22: error: 'size_t' is not a member of 'std'
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                      ^
/usr/include/c++/5/new:113:22: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:119:25: error: declaration of 'operator new' as non-function
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                         ^
/usr/include/c++/5/new:119:20: error: 'size_t' is not a member of 'std'
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                    ^
/usr/include/c++/5/new:119:20: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:119:33: error: expected primary-expression before 'const'
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                 ^
/usr/include/c++/5/new:121:27: error: declaration of 'operator new []' as non-function
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                           ^
/usr/include/c++/5/new:121:22: error: 'size_t' is not a member of 'std'
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                      ^
/usr/include/c++/5/new:121:22: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:121:35: error: expected primary-expression before 'const'
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                   ^
/usr/include/c++/5/new:129:32: error: declaration of 'operator new' as non-function
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                ^
/usr/include/c++/5/new:129:27: error: 'size_t' is not a member of 'std'
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                           ^
/usr/include/c++/5/new:129:27: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:129:40: error: expected primary-expression before 'void'
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                        ^
/usr/include/c++/5/new:131:34: error: declaration of 'operator new []' as non-function
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                  ^
/usr/include/c++/5/new:131:29: error: 'size_t' is not a member of 'std'
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                             ^
/usr/include/c++/5/new:131:29: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/5/cstdlib:72,
                 from /usr/include/c++/5/bits/stl_algo.h:59,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:216:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/5/bits/stl_construct.h:59:0,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/new:131:42: error: expected primary-expression before 'void'
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                          ^
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/ext/alloc_traits.h:38,
                 from /usr/include/c++/5/bits/stl_construct.h:61,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/ext/new_allocator.h:44:14: error: 'std::size_t' has not been declared
   using std::size_t;
              ^
/usr/include/c++/5/ext/new_allocator.h:45:14: error: 'std::ptrdiff_t' has not been declared
   using std::ptrdiff_t;
              ^
/usr/include/c++/5/ext/new_allocator.h:62:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t  difference_type;
               ^
In file included from /usr/include/c++/5/ext/alloc_traits.h:38:0,
                 from /usr/include/c++/5/bits/stl_construct.h:61,
                 from /usr/include/c++/5/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/5/bits/stl_algo.h:62,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/bits/allocator.h:67:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t   difference_type;
               ^
/usr/include/c++/5/bits/allocator.h:96:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t  difference_type;
               ^
In file included from /usr/include/c++/5/bits/stl_algo.h:62:0,
                 from /usr/include/c++/5/algorithm:62,
                 from teams.cpp:8:
/usr/include/c++/5/bits/stl_tempbuf.h:84:16: error: 'ptrdiff_t' was not declared in this scope
     pair<_Tp*, ptrdiff_t>
                ^
/usr/include/c++/5/bits/stl_tempbuf.h:84:25: error: template argument 2 is invalid
     pair<_Tp*, ptrdiff_t>
                         ^
/usr/include/c++/5/bits/stl_tempbuf.h:85:26: error: 'ptrdiff_t' was not declared in this scope
     get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
                          ^
/usr/include/c++/5/bits/stl_tempbuf.h:86:5: error: expected ';' before '{' token
     {
     ^
/usr/include/c++/5/bits/stl_tempbuf.h:131:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t   size_type;
               ^
/usr/include/c++/5/bits/stl_tempbuf.h:134:7: error: 'size_type' does not name a type
       size_type  _M_original_len;
       ^
/usr/include/c++/5/bits/stl_tempbuf.h:135:7: error: 'size_type' does not name a type
       size_type  _M_len;
       ^
/usr/include/c++/5/bits/stl_tempbuf.h:140:7: error: 'size_type' does not name a type
       size_type
       ^
/usr/include/c++/5/bits/stl_tempbuf.h:145:7: error: 'size_type' does not name a type
       size_type
       ^
/usr/include/c++/5/bits/stl_tempbuf.h: In member function 'std::_Temporary_buffer<_ForwardIterator, _Tp>::value_type* std::_Temporary_buffer<_ForwardIterator, _Tp>::end()':
/usr/include/c++/5/bits/stl_tempbuf.h:157:28: error: '_M_len' was not declared in this scope
       { return _M_buffer + _M_len; }
                            ^
/usr/include/c++/5/bits/stl_tempbuf.h: In destructor 'std::_Temporary_buffer<_ForwardIterator, _Tp>::~_Temporary_buffer()':
/usr/include/c++/5/bits/stl_tempbuf.h:167:39: error: '_M_len' was not declared in this scope
  std::_Destroy(_M_buffer, _M_buffer + _M_len);
                                       ^
/usr/include/c++/5/bits/stl_tempbuf.h: In constructor 'std::_Temporary_buffer<_ForwardIterator, _Tp>::_Temporary_buffer(_ForwardIterator, _ForwardIterator)':
/usr/include/c++/5/bits/stl_tempbuf.h:245:7: error: class 'std::_Temporary_buffer<_ForwardIterator, _Tp>' does not have any field named '_M_original_len'
     : _M_original_len(std::distance(__first, __last)),
       ^
/usr/include/c++/5/bits/stl_tempbuf.h:246:7: error: class 'std::_Temporary_buffer<_ForwardIterator, _Tp>' does not have any field named '_M_len'
       _M_len(0), _M_buffer(0)
       ^
/usr/include/c++/5/bits/stl_tempbuf.h:250:23: error: 'size_type' was not declared in this scope
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                       ^
/usr/include/c++/5/bits/stl_tempbuf.h:250:32: error: template argument 2 is invalid
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                                ^
/usr/include/c++/5/bits/stl_tempbuf.h:251:22: error: '_M_original_len' was not declared in this scope
          value_type>(_M_original_len));
                      ^
/usr/include/c++/5/bits/stl_tempbuf.h:252:20: error: request for member 'first' in '__p', which is of non-class type 'int'
    _M_buffer = __p.first;
                    ^
/usr/include/c++/5/bits/stl_tempbuf.h:253:4: error: '_M_len' was not declared in this scope
    _M_len = __p.second;
    ^
/usr/include/c++/5/bits/stl_tempbuf.h:253:17: error: request for member 'second' in '__p', which is of non-class type 'int'
    _M_len = __p.second;
                 ^
/usr/include/c++/5/bits/stl_tempbuf.h:262:4: error: '_M_len' was not declared in this scope
    _M_len = 0;
    ^
In file included from /usr/include/c++/5/iosfwd:40:0,
                 from /usr/include/c++/5/ios:38,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from teams.cpp:9:
/usr/include/c++/5/bits/postypes.h: At global scope:
/usr/include/c++/5/bits/postypes.h:98:11: error: 'ptrdiff_t' does not name a type
   typedef ptrdiff_t streamsize; // Signed integral type
           ^
In file included from /usr/include/c++/5/ios:40:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from teams.cpp:9:
/usr/include/c++/5/bits/char_traits.h:104:66: error: 'std::size_t' has not been declared
       compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
                                                                  ^
/usr/include/c++/5/bits/char_traits.h:106:19: error: 'size_t' in namespace 'std' does not name a type
       static std::size_t
                   ^
/usr/include/c++/5/bits/char_traits.h:110:39: error: 'std::size_t' has not been declared
       find(const char_type* __s, std::size_t __n, const char_type& _