Submission #796596

#TimeUsernameProblemLanguageResultExecution timeMemory
796596TheSahibScales (IOI15_scales)C++14
45.45 / 100
1 ms304 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } vector<int> v = {1, 2, 3, 4, 5 , 6}; void erase(int a){ v.erase(find(v.begin(), v.end(), a)); } void orderCoins() { v.resize(6); iota(v.begin(), v.end(), 1); int mx1 = getHeaviest(1, 2, 3); int mx2 = getHeaviest(4, 5, 6); erase(mx1); erase(mx2); v.push_back(mx1); v.push_back(mx2); int mx3 = getHeaviest(v[5], v[4], v[3]); int md1 = getMedian(v[5], v[4], v[3]); erase(mx3); erase(md1); v.push_back(md1); v.push_back(mx3); int mn1 = getLightest(v[0], v[1], v[2]); int md2 = getMedian(v[0], v[1], v[2]); erase(mn1); erase(md2); v.insert(v.begin(), md2); v.insert(v.begin(), mn1); int a = v[3], b = v[4], c = v[5]; for (int i = 0; i < 3; i++) { int idx = getNextLightest(a, b, c, v[0]); v.insert(find(v.begin(), v.end(), idx), v[0]); v.erase(v.begin()); } int ans[6]; for (int i = 0; i < 6; i++) { ans[i] = v[i]; } answer(ans); }

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...