Submission #604307

#TimeUsernameProblemLanguageResultExecution timeMemory
604307wiwihoScales (IOI15_scales)C++14
55.56 / 100
2 ms256 KiB
#include "scales.h" #include <bits/stdc++.h> #define iter(a) a.begin(), a.end() #define lsort(a) sort(iter(a)) #define gsort(a) sort(iter(a), greater<>()) #define eb emplace_back #define ef emplace_front #define pob pop_back() #define pof pop_front() #define mp make_pair #define F first #define S second #define uni(a) a.resize(unique(iter(a)) - a.begin()) #define printv(a, b){ \ for(auto pv : a) b << pv << " "; \ b << "\n"; \ } using namespace std; typedef long long ll; typedef long double ld; using pii = pair<int, int>; using pll = pair<ll, ll>; template<typename A, typename B> ostream& operator<<(ostream& o, pair<A, B> p){ return o << '(' << p.F << ',' << p.S << ')'; } void init(int T){ } void orderCoins(){ vector<int> v1, v2; { int l = getLightest(1, 2, 3); int r = getHeaviest(1, 2, 3); v1.eb(l); v1.eb(l ^ r ^ 1 ^ 2 ^ 3); v1.eb(r); } { int l = getLightest(4, 5, 6); int r = getHeaviest(4, 5, 6); v2.eb(l); v2.eb(l ^ r ^ 4 ^ 5 ^ 6); v2.eb(r); } printv(v1, cerr); printv(v2, cerr); int lp = 0, rp = 1; vector<vector<int>> hole(4); for(int i = 0; i < 3; i++){ cerr << "test " << i << " " << lp << " " << rp << "\n"; int m = getMedian(v1[lp], v1[rp], v2[i]); if(m == v1[lp]){ hole[lp].eb(v2[i]); } else if(m == v2[i]){ hole[rp].eb(v2[i]); } else{ if(rp == 1){ lp++; rp++; i--; continue; } hole[rp + 1].eb(v2[i]); } } vector<int> ans; for(int i = 0; i < 4; i++){ for(int j : hole[i]) ans.eb(j); if(i == 3) break; ans.eb(v1[i]); } int av[6]; for(int i = 0; i < 6; i++) av[i] = ans[i]; answer(av); }

Compilation message (stderr)

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