Submission #520085

#TimeUsernameProblemLanguageResultExecution timeMemory
520085pisikakaScales (IOI15_scales)C++17
0 / 100
1 ms336 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { return; } void orderCoins() { int w[] = {1, 2, 3, 4, 5, 6}, ans[6]; for(int k = 0; k < 4; ++k){ for(int i = 0; i < 4; ++i){ int v = getLightest(w[i], w[i+1], w[i+2]); for(int j = i; j <= i+2; ++j) if(v == w[j]) swap(w[i], w[j]); v = getMedian(w[i], w[i+1], w[i+2]); for(int j = i; j <= i+2; ++j) if(v == w[j]) swap(w[i], w[j]); } } answer(w); return; }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
    5 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:10:35: warning: unused variable 'ans' [-Wunused-variable]
   10 |     int w[] = {1, 2, 3, 4, 5, 6}, ans[6];
      |                                   ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...