Submission #120187

#TimeUsernameProblemLanguageResultExecution timeMemory
120187patrikpavic2Scales (IOI15_scales)C++17
55.56 / 100
2 ms384 KiB
#include "scales.h" #include <vector> #include <algorithm> #define PB push_back using namespace std; void init(int T) { } void orderCoins() { int A = getLightest(1, 2, 3); int F = getHeaviest(4, 5, 6); int B = 1 + (A <= 1), C = 2 + (A <= 2); int D = 4 + (F <= 4), E = 5 + (F <= 5); //printf("%d %d %d %d %d %d\n", A, B, C, D, E, F); int AA = getLightest(A, D, E); int FF = getHeaviest(F, B, C); if(AA == D) swap(A, D); if(AA == E) swap(A, E); if(FF == B) swap(F, B); if(FF == C) swap(F, C); int BB = getLightest(B, C, D); if(BB == C) swap(B, C); if(BB == D) swap(B, D); BB = getLightest(B, D, E); if(BB == E) swap(B, E); int EE = getHeaviest(C, D, E); if(EE == C) swap(E, C); if(EE == D) swap(E, D); int CC = getLightest(C, D, E); if(CC == D) swap(C, D); int W[] = {A, B, C, D, E, F}; answer(W); }

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:9:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...