Submission #1120506

#TimeUsernameProblemLanguageResultExecution timeMemory
1120506epicci23Scales (IOI15_scales)C++17
45.45 / 100
2 ms596 KiB
#include "bits/stdc++.h" #include "scales.h" //#define int long long #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; void init(int T){ } void orderCoins(){ array<int,3> a,b; set<int> s; for(int i=1;i<=3;i++) s.insert(i); a[2] = getHeaviest(1, 2, 3); a[0] = getLightest(1, 2, 3); s.erase(a[2]);s.erase(a[0]); a[1] = *s.begin(); s.erase(a[1]); for(int i=4;i<=6;i++) s.insert(i); b[2] = getHeaviest(4, 5, 6); b[0] = getLightest(4, 5, 6); s.erase(b[2]);s.erase(b[0]); b[1] = *s.begin(); s.erase(b[1]); int p1 = 0 , p2 = 0 , p3 = 0; int W[6]; int U = getLightest(a[0], b[0], a[1]); if(U == a[0]) W[p3++] = a[p1++]; else W[p3++] = b[p2++]; while(p1 < 3 && p2 < 3){ int u = getMedian(W[0] , a[p1] , b[p2]); if(u == a[p1]) W[p3++] = a[p1++]; else W[p3++] = b[p2++]; } while(p1 < 3) W[p3++] = a[p1++]; while(p2 < 3) W[p3++] = b[p2++]; answer(W); }

Compilation message (stderr)

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