Submission #242847

#TimeUsernameProblemLanguageResultExecution timeMemory
242847godwindScales (IOI15_scales)C++14
45.45 / 100
6 ms432 KiB
#include "scales.h" #include <iostream> #include <vector> #include <algorithm> #include <random> #include <set> #include <map> #include <queue> #include <cstring> #include <cmath> #include <bitset> #include <iomanip> #include <functional> using namespace std; void init(int T) { /* ... */ } int mex(int i, int j) { for (int x = 1; x <= 6; ++x) { if (x != i && x != j) { return x; } } return -1; } bool lss(int i, int j) { return getLightest(i, j, mex(i, j)); } vector<int> proceed(int a, int b, int c) { int x = getLightest(a, b, c); int y = getMedian(a, b, c); int z = a + b + c - x - y; vector<int> v; v.emplace_back(x); v.emplace_back(y); v.emplace_back(z); return v; } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; vector<int> A = proceed(1, 2, 3); vector<int> B = proceed(4, 5, 6); vector<int> ans; int F = 0, S = 0; for (int it = 0; it < 6; ++it) { if (F == 3) { ans.emplace_back(B[S++]); } else if (S == 3) { ans.emplace_back(A[F++]); } else { int rest = -1; if (F + 1 < 3) rest = A[F + 1]; if (S + 1 < 3) rest = B[S + 1]; if (rest == -1) { rest = A[0]; if (getMedian(A[F], B[S], rest) == A[F]) { ans.emplace_back(A[F++]); } else { ans.emplace_back(B[S++]); } } else { if (getLightest(A[F], B[S], rest) == A[F]) { ans.emplace_back(A[F++]); } else { ans.emplace_back(B[S++]); } } } } for (int i = 0; i < 6; ++i) W[i] = ans[i]; answer(W); }

Compilation message (stderr)

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