Submission #744572

#TimeUsernameProblemLanguageResultExecution timeMemory
744572Abrar_Al_SamitScales (IOI15_scales)C++17
0 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::system_clock::now().time_since_epoch().count()); void init(int T) { } void solve3(int *a) { int mn = getLightest(*a, *(a+1), *(a+2)); if(mn==*(a+1)) swap(*a, *(a+1)); else if(mn==*(a+2)) swap(*a, *(a+2)); int mx = getHeaviest(*a, *(a+1), *(a+2)); if(mx==*(a+1)) swap(*(a+1), *(a+2)); } void orderCoins() { int a[6] = {1, 2, 3, 4, 5, 6}; //random_shuffle(a, a+6); solve3(&a[0]); solve3(&a[3]); if(getLightest(a[0], a[1], a[3])==a[3]) { swap(a[0], a[3]); swap(a[1], a[4]); swap(a[2], a[5]); } int before = getNextLightest(a[0], a[1], a[2], a[3]); if(before==a[1]) { swap(a[2], a[3]); swap(a[1], a[2]); } else if(before==a[2]) { swap(a[2], a[3]); } else { answer(a); return; } before = getNextLightest(a[1], a[2], a[3], a[4]); if(before==a[2]) { swap(a[3], a[4]); swap(a[2], a[3]); } else if(before==a[3]) { swap(a[3], a[4]); } else { answer(a); return; } if(getHeaviest(a[3], a[4], a[5])==a[4]) { swap(a[4], a[5]); } answer(a); }

Compilation message (stderr)

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