Submission #358042

#TimeUsernameProblemLanguageResultExecution timeMemory
358042tengiz05Scales (IOI15_scales)C++17
55.56 / 100
1 ms512 KiB
#include "scales.h" #ifndef EVAL #include "grader.cpp" #endif #include <bits/stdc++.h> using namespace std; void init(int T){ } void print(int a[]){ for(int i=1;i<=6;i++)cout << a[i] << ' '; cout << '\n'; return; } void orderCoins(){ int a[10] = {0,0,0,0,0,0,0,0,0,0}; int ans[6] = {1,2,3,4,5,6}; vector<int> remain = {1,2,3,4,5,6}; a[7] = getLightest(1,2,3); a[8] = getLightest(4,5,6); int t = getLightest(a[7], a[8], (a[7]==1)?2:1); a[1] = t; remain.erase(find(remain.begin(),remain.end(),a[1])); if(a[1] <= 3){ a[2] = getLightest(remain[0],remain[1],a[8]); }else { a[2] = getLightest(remain[3],remain[4],a[7]); }remain.erase(find(remain.begin(),remain.end(),a[2])); //~ print(a); a[3] = getHeaviest(remain[0],remain[1],remain[2]); a[6] = getHeaviest(remain[3],a[1],a[3]); remain.erase(find(remain.begin(),remain.end(),a[6])); a[5] = getHeaviest(remain[0],remain[1],remain[2]); remain.erase(find(remain.begin(),remain.end(),a[5])); a[3] = getLightest(remain[0],remain[1],a[6]); remain.erase(find(remain.begin(),remain.end(),a[3])); assert(remain.size() == 1); a[4] = remain[0]; //~ print(a); for(int i=0;i<6;i++)ans[i] = a[i+1]; answer(ans); 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...