Submission #299411

#TimeUsernameProblemLanguageResultExecution timeMemory
299411Pichon5Scales (IOI15_scales)C++17
45.45 / 100
1 ms288 KiB
#include "scales.h" #include <bits/stdc++.h> #define vi vector<int> #define pb push_back using namespace std; void init(int T) { /* ... */ } void orderCoins() { /* ... */ vector<int>res; vector<bool>vis; vis.assign(7,false); //----- int a= getLightest(1,2,3); int b= getLightest(4,5,6); int c=1; if(a==c){ c=2; } a=getLightest(a,b,c); res.pb(a); vis[a]=true; //------ vector<int>v; v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); b=getLightest(a,v[3],v[4]); res.pb(b); vis[b]=true; //--------- v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); b=v[0]; if(a==b){ b=v[1]; } c=getLightest(a,b,v[3]); vis[c]=true; res.pb(c); //------------ v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); vis[a]=true; res.pb(a); //------------ v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getMedian(res[0],v[0],v[1]); res.pb(a); vis[a]=true; for(int i=1;i<=6;i++){ if(vis[i]==false){ res.pb(i); break; } } int W[6]; for(int i=0;i<6;i++){ W[i]=res[i]; } answer(W); return ; }

Compilation message (stderr)

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