Submission #835038

#TimeUsernameProblemLanguageResultExecution timeMemory
835038MadokaMagicaFanScales (IOI15_scales)C++14
6.02 / 100
1 ms428 KiB
#include "bits/stdc++.h" #include "scales.h" using namespace std; void init(int T) { } int c = 0; int isGreater(int a, int b) { int k; if (a == 1 && b == 6) k = 2; else if (a == 6 && b == 1) k = 2; else if (b == 6) k = 1; else if (a == 6) k = 1; else k = 6; int v1, v2, v3; v3 = getHeaviest(a, b, k); v2 = getMedian(a, b, k); v1 = getLightest(a, b, k); c += 3; if (v1 == b) return 1; if (v1 == a || v2 == a) return 0; return 1; } void orderCoins() { int ans[6]; int k; for (int i = 1; i <= 6; ++i) ans[i-1] = i; for (int i = 0; i < 6; ++i) { for (int j = i+1; j < 6; ++j) { if (isGreater(ans[i], ans[j])) swap(ans[i], ans[j]); } } answer(ans); }

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 'int isGreater(int, int)':
scales.cpp:19:14: warning: variable 'v3' set but not used [-Wunused-but-set-variable]
   19 |  int v1, v2, v3;
      |              ^~
scales.cpp: In function 'void orderCoins()':
scales.cpp:32:6: warning: unused variable 'k' [-Wunused-variable]
   32 |  int k;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...