Submission #425668

#TimeUsernameProblemLanguageResultExecution timeMemory
425668Blistering_BarnaclesToy Train (IOI17_train)C++11
Compilation error
0 ms0 KiB
#include "train.h" //apig's property //Happiness can be found, even in the darkest of times, if one only remembers to turn on the light //El Pueblo Unido Jamas Sera Vencido //The saddest thing about betrayal? is that it never comes from your enemies //Do or do not... there is no try //Billions of bilious blue blistering barnacles in a thundering typhoon! #include<bits/stdc++.h> #define fast ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) #define F first #define S second #define pb push_back #define vll vector< ll > #define vi vector< int > #define pll pair< ll , ll > #define pi pair< int , int > #define all(s) s.begin() , s.end() #define sz(s) s.size() #define str string #define md ((s + e) / 2) #define mid ((l + r) / 2) #define msdp(dp) memset(dp , -1 , sizeof dp) #define mscl(dp) memset(dp , 0 , sizeof dp) #define C continue #define R return #define B break #define lx node * 2 #define rx node * 2 + 1 #define br(o) o ; break #define co(o) o ; continue using namespace std; typedef long long ll; ll q, dp[100005], a[555555] , b[555555], k, l, m, n, o, p; map < ll , ll > mp; vll adj[555555]; const ll mod = 1e9+7; str s; vll is , not ; ll mem(ll i){ if(i == n)R 0 ; ll &r = dp[i] ; if(r != -1)R r ; if(is[i]){ if(not[i]){ if(b[i] & (1 << 1))r = 1 ; else r = mem(i + 1) ; } else { if(b[i] & (1 << 0))R r = mem(i + 1) ; r = 0 ; } } else { if(not[i]){ if(b[i] & (1 << 0))r = mem(i + 1) ; else r = 1 ; } else { if(b[i] & (1 << 1))r = 0 ; else r = mem(i + 1) ; } } R r ; } vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { is = a , not = r ; msdp(dp) ; vll ans ; n = sz(a) ; m = sz(u) ; for(ll i = 0 ; i < m ; i++){ ll op = (u[i] == v[i]) ; b[u[i]] |= (1 << (op)) ; } for(ll i = 0 ; i < n ; i++){ ans.pb(mem(i)) ; } R ans ; }

Compilation message (stderr)

train.cpp:38:10: error: expected unqualified-id before 'not' token
   38 | vll is , not ;
      |          ^~~
train.cpp: In lambda function:
train.cpp:44:18: error: expected '{' before ')' token
   44 |         if(not[i]){
      |                  ^
train.cpp: In function 'll mem(ll)':
train.cpp:44:12: error: no match for 'operator!' (operand type is 'mem(ll)::<lambda()>')
   44 |         if(not[i]){
train.cpp:44:12: note: candidate: 'operator!(bool)' (built-in)
train.cpp:44:12: note:   no known conversion for argument 1 from 'mem(ll)::<lambda()>' to 'bool'
train.cpp: In lambda function:
train.cpp:54:18: error: expected '{' before ')' token
   54 |         if(not[i]){
      |                  ^
train.cpp: In function 'll mem(ll)':
train.cpp:54:12: error: no match for 'operator!' (operand type is 'mem(ll)::<lambda()>')
   54 |         if(not[i]){
train.cpp:54:12: note: candidate: 'operator!(bool)' (built-in)
train.cpp:54:12: note:   no known conversion for argument 1 from 'mem(ll)::<lambda()>' to 'bool'
train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:66:7: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'std::vector<int>')
   66 |  is = a , not = r ;
      |       ^
In file included from /usr/include/c++/10/vector:72,
                 from train.h:1,
                 from train.cpp:1:
/usr/include/c++/10/bits/vector.tcc:198:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  198 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/vector.tcc:199:42: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<long long int>&'
  199 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/10/vector:67,
                 from train.h:1,
                 from train.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:709:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:709:26: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<long long int>&&'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:730:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  730 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:730:46: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::initializer_list<long long int>'
  730 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
train.cpp:66:15: error: expected primary-expression before '=' token
   66 |  is = a , not = r ;
      |               ^
train.cpp:78:4: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
   78 |  R ans ;
      |    ^~~
      |    |
      |    vector<long long int>