Submission #783706

#TimeUsernameProblemLanguageResultExecution timeMemory
783706lollipopScales (IOI15_scales)C++17
0 / 100
1 ms340 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(){
     int a = getLightest( 1 , 2 , 3 ) ;
     int b = getMedian( 1 , 2 , 3 ) ;
	 int c = 6 - a - b ;
     int d = getLightest( 4 , 5 , 6 ) ;
     int e = getMedian( 4 , 5 , 6 ) ;
	 int f = 15 - 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 ; 
	 }
	 // e1
	 x = getNextLightest( a , b , c , e ) ;
	 if( x != a ){
	 	if( x == b ) e1 = 1 ; 
	 	if( x == c ) e1 = 2 ; 
	 }
	 else{
	 	x = getHeaviest( b , c , e ) ;
	 	if( x == d ) e1 = 3 ;
	 	else e1 = 0 ; 
	 }
	 // f1
	 x = getNextLightest( a , b , c , f ) ;
	 if( x != a ){
	 	if( x == b ) f1 = 1 ; 
	 	if( x == c ) f1 = 2 ; 
	 }
	 else{
	 	x = getHeaviest( b , c , f ) ;
	 	if( x == d ) 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 ) ;	 
	 int pas[ 6 ] ;
	 FOR( i , 6 ) pas[ i ] = v[ i ] ;
     answer( pas ) ;
}



Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:37:15: warning: unused parameter 'T' [-Wunused-parameter]
   37 | void init(int T){
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...