Submission #617948

#TimeUsernameProblemLanguageResultExecution timeMemory
617948blueScales (IOI15_scales)C++17
45.45 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; //9 QUERIES using vi = vector<int>; using vvi = vector<vi>; #define sz(x) int(x.size()) void init(int T) { /* ... */ } void orderCoins() { deque<int> l(3); l[0] = getLightest(1, 2, 3); l[1] = getMedian(1, 2, 3); l[2] = 6 - l[0] - l[1]; deque<int> m(3); m[0] = getLightest(4, 5, 6); m[1] = getMedian(4, 5, 6); m[2] = 4+5+6 - m[0] - m[1]; deque<int> n; while(1) { if(l.empty()) { for(int f : m) n.push_back(f); break; } if(m.empty()) { for(int f : l) n.push_back(f); break; } int a = 0; if(sz(l) >= 2) { a = getLightest(l[0], l[1], m[0]); } else if(sz(m) >= 2) { a = getLightest(l[0], m[0], m[1]); } else a = getMedian(l[0], m[0], n[0]); if(l[0] == a) l.pop_front(); else m.pop_front(); n.push_back(a); } int W[] = {n[0], n[1], n[2], n[3], n[4], n[5]}; answer(W); }

Compilation message (stderr)

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