제출 #783778

#제출 시각아이디문제언어결과실행 시간메모리
783778lollipop저울 (IOI15_scales)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> //#define int long long #define pb push_back #define s second #define f first #define pf push_front #define inf 100000000000000000 #define bitebi __builtin_popcountll #define FOR( i , n ) for( int i = 0 ; i < n ; i ++ ) #define YES cout <<"YES\n" #define NO cout << "NO\n" #define debug cout << "Here Fine" << endl ; #define pr pair < int , int > #define fbo find_by_order // returns iterator #define ook order_of_key // returns strictly less numbers than key using namespace std ; //#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") using namespace __gnu_pbds; using namespace __gnu_cxx; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> const double Pi=acos(-1.0); const double EPS=1E-8; const int mod = 1000000007 ; const int mod1 = 998244353 ; const int N = 2e5 + 10 ; mt19937 R(time(0)); map < int , int > ma , ma1 ; #include "scales.h" void init(int T){ // heheh } void orderCoins(){ vector < int > vi ; FOR( i , 6 ) vi.pb( i + 1 ) ; random_shuffle( vi ) ; random_shuffle( vi ) ; int a = getLightest( vi[ 0 ] , vi[ 1 ] , vi[ 2 ] ) ; int b = getMedian( vi[ 0 ] , vi[ 1 ] , vi[ 2 ] ) ; int c = vi[ 0 ] + vi[ 1 ] + vi[ 2 ] - a - b ; int d = getLightest( vi[ 3 ] , vi[ 4 ] , vi[ 5 ] ) ; int e = getMedian( vi[ 3 ] , vi[ 4 ] , vi[ 5 ] ) ; int f = vi[ 3 ] + vi[ 4 ] + vi[ 5 ] - d - e ; int d1 , e1 , f1 , x ; // d1 x = getNextLightest( a , b , c , d ) ; if( x != a ){ if( x == b ) d1 = 1 ; if( x == c ) d1 = 2 ; } else{ x = getHeaviest( b , c , d ) ; if( x == d ) d1 = 3 ; else d1 = 0 ; } if( d1 == 3 ){ e1 = 3 ; f1 = 3 ; } else{ // e1 x = getNextLightest( a , b , c , e ) ; if( x != a ){ if( x == b ) e1 = 1 ; if( x == c ) e1 = 2 ; } else{ if( d1 != 0 ){ e1 = 3 ; } else{ x = getHeaviest( b , c , e ) ; if( x == e ) e1 = 3 ; else e1 = 0 ; } } if( e1 == 3 ){ f1 = 3 ; } else{ // f1 x = getNextLightest( a , b , c , f ) ; if( x != a ){ if( x == b ) f1 = 1 ; if( x == c ) f1 = 2 ; } else{ if( e1 != 0 ){ f1 =3 ; } else{ x = getHeaviest( b , c , f ) ; if( x == f ) f1 = 3 ; else f1 = 0 ; } } } } // now answer vector < int > v ; if( d1 == 0 ) v.pb( d ) ; if( e1 == 0 ) v.pb( e ) ; if( f1 == 0 ) v.pb( f ) ; v.pb( a ) ; if( d1 == 1 ) v.pb( d ) ; if( e1 == 1 ) v.pb( e ) ; if( f1 == 1 ) v.pb( f ) ; v.pb( b ) ; if( d1 == 2 ) v.pb( d ) ; if( e1 == 2 ) v.pb( e ) ; if( f1 == 2 ) v.pb( f ) ; v.pb( c ) ; if( d1 == 3 ) v.pb( d ) ; if( e1 == 3 ) v.pb( e ) ; if( f1 == 3 ) v.pb( f ) ; // for( auto x : v ) cout << x << endl ; int W[] = { v[ 0 ] , v[ 1 ] , v[ 2 ] , v[ 3 ] , v[ 4 ] , v[ 5 ] } ; answer( W ) ; }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'void init(int)':
scales.cpp:37:15: warning: unused parameter 'T' [-Wunused-parameter]
   37 | void init(int T){
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:44:21: error: no matching function for call to 'random_shuffle(std::vector<int>&)'
   44 |  random_shuffle( vi ) ;
      |                     ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4585:5: note: candidate: 'template<class _RAIter> void std::random_shuffle(_RAIter, _RAIter)'
 4585 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:4585:5: note:   template argument deduction/substitution failed:
scales.cpp:44:21: note:   candidate expects 2 arguments, 1 provided
   44 |  random_shuffle( vi ) ;
      |                     ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4620:5: note: candidate: 'template<class _RAIter, class _Generator> void std::random_shuffle(_RAIter, _RAIter, _Generator&&)'
 4620 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:4620:5: note:   template argument deduction/substitution failed:
scales.cpp:44:21: note:   candidate expects 3 arguments, 1 provided
   44 |  random_shuffle( vi ) ;
      |                     ^
scales.cpp:45:21: error: no matching function for call to 'random_shuffle(std::vector<int>&)'
   45 |  random_shuffle( vi ) ;
      |                     ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4585:5: note: candidate: 'template<class _RAIter> void std::random_shuffle(_RAIter, _RAIter)'
 4585 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:4585:5: note:   template argument deduction/substitution failed:
scales.cpp:45:21: note:   candidate expects 2 arguments, 1 provided
   45 |  random_shuffle( vi ) ;
      |                     ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4620:5: note: candidate: 'template<class _RAIter, class _Generator> void std::random_shuffle(_RAIter, _RAIter, _Generator&&)'
 4620 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algo.h:4620:5: note:   template argument deduction/substitution failed:
scales.cpp:45:21: note:   candidate expects 3 arguments, 1 provided
   45 |  random_shuffle( vi ) ;
      |                     ^