Submission #1242430

#TimeUsernameProblemLanguageResultExecution timeMemory
1242430tkm_algorithmsScales (IOI15_scales)C++20
0 / 100
0 ms320 KiB
/** * In the name of Allah * We are nothing and you're everything * Ya Muhammad! **/ #include <bits/stdc++.h> #include "scales.h" using namespace std; using ll = long long; using ull = uint64_t; #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() //#define int long long void init(int T) { } void orderCoins() { int bir, iki; bir = getLightest(1, 2, 3); iki = getLightest(4, 5, 6); int ne = 1; if (ne == bir || ne == iki)ne++; if (ne == bir || ne == iki)ne++; int an = getLightest(bir, iki, ne); int res[6]; res[0] = an; vector<int> g; for (int i = 1; i <= 6; ++i)if (bir != i)g.push_back(i); iki = (an==bir?iki:bir); res[1] = iki; g.erase(find(all(g), iki)); int uc = getLightest(g[0], g[1], g[2]); uc = getMedian(uc, bir, g[3]); res[2] = uc; g.erase(find(all(g), uc)); int dort = getLightest(g[0], g[1], g[2]); res[3] = dort; g.erase(find(all(g), dort)); int bas = getMedian(bir, g[0], g[1]); res[4] = bas; g.erase(find(all(g), bas)); res[5] = g[0]; answer(res); }
#Verdict Execution timeMemoryGrader output
Fetching results...