Submission #802715

#TimeUsernameProblemLanguageResultExecution timeMemory
802715FatihSolakScales (IOI15_scales)C++17
55.56 / 100
1 ms212 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } void orderCoins() { mt19937 rng(chrono::steady_clock().now().time_since_epoch().count()); vector<int> ord = {1,2,3,4,5,6}; shuffle(ord.begin(),ord.end(),rng); vector<int> v = {ord[0]}; for(int i = 2;i<=4;i+=2){ v[0] = getHeaviest(v[0],ord[i-1],ord[i]); } int tmp = ord[4 - (v[0] == ord[4])]; int val = getMedian(v[0],tmp,ord[5]); if(val == tmp){ v = {ord[5],tmp,v[0]}; } else if(val == ord[5]){ v = {tmp,ord[5],v[0]}; } else{ v = {tmp,v[0],ord[5]}; } for(int i = 1;i<=6;i++){ int num = ord[i-1]; bool ok = 1; for(auto u:v){ if(u == num) ok = 0; } if(!ok) continue; int vall = getNextLightest(v[v.size() - 3],v[v.size()-2],v[v.size()-1],num); if(vall == v[v.size() - 3] && v.size() > 3){ vall = getNextLightest(v[0],v[1],v[2],num); } vector<int> tmpp; for(auto u:v){ if(u == vall) tmpp.push_back(num); tmpp.push_back(u); } v = tmpp; } int W[] = {v[0],v[1],v[2],v[3],v[4],v[5]}; answer(W); }

Compilation message (stderr)

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