Submission #1166521

#TimeUsernameProblemLanguageResultExecution timeMemory
1166521SangMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#ifndef _Pbrngw_ #include "Alice.h" #endif // _Pbrngw_ #include<bits/stdc++.h> using namespace std; #define int long long #define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++) #define FORD(i, a, b) for (int i = (a), _b = (b); i >= _b; i--) #define fi first #define se second #define pb push_back #define ALL(a) (a).begin(), (a).end() #define task "kbsiudthw" typedef vector<int> vi; typedef pair<int32_t, int32_t> ii; typedef pair<int, ii> pii; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; const int MOD = 1e9 + 2277; mt19937_64 rd(time(0)); int Rand(int l, int r){ return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1); } vector<ii> Alice(){ int x = setN(5000); vector<ii> edges; edges.pb({1, 2}); FOR (i, 3, 5000){ int t = (i - 3) % 25; int c = (x>>t)&1; int par = Rand(1, i - 1); if ((par & 1) != (c & 1)){ if (par + 1 >= i) par--; else par++; } edges.pb({par, i}); } return edges; } #ifdef _Pbrngw_ signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if (fopen(task".inp", "r")){ freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } return 0; } #endif // _Pbrngw_
#ifndef _Pbrngw_ #include "Bob.h" #endif // _Pbrngw_ #include<bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++) #define FORD(i, a, b) for (int i = (a), _b = (b); i >= _b; i--) #define fi first #define se second #define pb push_back #define ALL(a) (a).begin(), (a).end() #define task "kbsiudthw" typedef vector<int> vi; typedef pair<int, int> ii; typedef pair<int, ii> pii; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; const int MOD = 1e9 + 2277; long long Bob(vector<ii> V){ long long ans = 0; for (ii &x : V){ if (x.se <= 2) continue; int c = (x.se - 3)%25; if (x.fi&1) ans |= (1ll<<c); } return ans; } #ifdef _Pbrngw_ signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if (fopen(task".inp", "r")){ freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } return 0; } #endif // _Pbrngw_

Compilation message (stderr)

# 1번째 컴파일 단계

Alice.cpp: In function 'long long int Rand(long long int, long long int)':
Alice.cpp:27:19: error: no match for 'operator%' (operand types are 'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} and 'long long int')
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                 ~~^~~~~~~~~~~~
      |                 |         |
      |                 |         long long int
      |                 std::mt19937_64 {aka std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>}
In file included from /usr/include/c++/11/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/c++/11/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/c++/11/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/c++/11/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/c++/11/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/valarray:1190:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const std::valarray<_Tp>&, const std::valarray<_Tp>&)'
 1190 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/valarray:1190:1: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} is not derived from 'const std::valarray<_Tp>'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/valarray:1190:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const std::valarray<_Tp>&, const typename std::valarray<_Tp>::value_type&)'
 1190 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/valarray:1190:1: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   'std::mt19937_64' {aka 'std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>'} is not derived from 'const std::valarray<_Tp>'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
                 from Alice.cpp:4:
/usr/include/c++/11/valarray:1190:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename std::valarray<_Tp>::value_type&, const std::valarray<_Tp>&)'
 1190 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/valarray:1190:1: note:   template argument deduction/substitution failed:
Alice.cpp:27:30: note:   mismatched types 'const std::valarray<_Tp>' and 'long long int'
   27 |     return l + (rd%(r - l + 1) + r - l + 1)%(r - l + 1);
      |                              ^