Submission #358307

#TimeUsernameProblemLanguageResultExecution timeMemory
358307kylych03Scales (IOI15_scales)C++14
0 / 100
2 ms384 KiB
#include "scales.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; void init(int T) { /* ... */ } void orderCoins() { int w[] = {1, 2, 3, 4, 5, 6}; /// int x = getLightest(w[0], w[1], w[2]); if ( x == w[2]) swap(w[0] , w[2]); if ( x == w[1]) swap(w[0] , w[1]); // x = getMedian (w[0], w[1], w[2]); if ( x == w[2]) swap(w[2] , w[1]); // swap(w[0], w[3]); swap(w[1], w[4]); swap(w[2], w[5]); // x = getLightest(w[0], w[1], w[2]); if ( x == w[2]) swap(w[0] , w[2]); if ( x == w[1]) swap(w[0] , w[1]); // x = getMedian (w[0], w[1], w[2]); if ( x == w[2]) swap(w[2] , w[1]); x = getMedian (w[0], w[1], w[4]); if( x == w[0]){ swap(w[0] , w[3]); swap(w[1] , w[4]); swap(w[2] , w[3]); swap(w[3] , w[4]); x = getMedian (w[2], w[3], w[5]); if(x == w[2]){ swap(w[5], w[2]); swap(w[5], w[3]); swap(w[5], w[4]); } else if(x == w[5]){ swap(w[5], w[3]); swap(w[5], w[4]); } else{ x = getMedian (w[3], w[4], w[5]); if( x == w[5]) swap( w[4], w[5]); } } else if(x == w[1]){ swap(w[1], w[3]); swap(w[2], w[3]); x = getMedian (w[0], w[1], w[2]); if(x == w[0]) swap(w[0], w[1]); x = getMedian (w[3], w[4], w[5]); if(x == w[3] || x == w[5]) swap( w[3], w[4]); if( x == w[5]) swap( w[4], w[5]); } else { swap(w[1], w[3]); swap(w[2], w[4]); x = getMedian (w[0], w[1], w[2]); if(x == w[0]) swap(w[0], w[1]); x = getMedian (w[3], w[4], w[5]); if(x == w[3]){ swap(w[3], w[5]); swap(w[4], w[5]); } if( x == w[5]) swap(w[4], w[5]); } answer(w); }

Compilation message (stderr)

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