Submission #407124

#TimeUsernameProblemLanguageResultExecution timeMemory
407124MDarioScales (IOI15_scales)C++11
57.12 / 100
1 ms204 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second void init(int T) { return ; } void orderCoins() { /* ... */ int w[] = {1, 2, 3, 4, 5, 6}, c; vector<int> v1, v2; c=6; v1.push_back(getLightest(1, 2, 3)); c-=v1.back(); v1.push_back(getMedian(1, 2, 3)); c-=v1.back(); v1.push_back(c); c=4+5+6; v2.push_back(getLightest(4, 5, 6)); c-=v2.back(); v2.push_back(getMedian(4, 5, 6)); c-=v2.back(); v2.push_back(c); int c1=0, c2=0; while(c1<=2||c2<=2){ if(c1>c2){ swap(c1, c2); swap(v1, v2); } if(c2==3){ for(int i=c1; i<=2; i++){ w[c2+c1]=v1[c1]; c1++; } } else if(c1<=1){ c=getMedian(v1[c1], v2[c2], v1[c1+1]); if(c==v1[c1]){ w[c1+c2]=v2[c2]; c2++; } else if(c==v1[c1+1]){ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v1[c1]; c1++; } else{ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v2[c2]; c2++; } } else if(c1==2&&c2==2){ c=getHeaviest(v1[c1], v2[c2], v1[c1-1]); if(c==v1[c1]){ w[c1+c2]=v2[c2]; c2++; w[c1+c2]=v1[c1]; c1++; } else{ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v2[c2]; c2++; } } } answer(w); return ; }

Compilation message (stderr)

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