Submission #64232

#TimeUsernameProblemLanguageResultExecution timeMemory
64232IvanCScales (IOI15_scales)C++17
55.56 / 100
3 ms636 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; void init(int T){ } void orderCoins(){ // Passo 1 : ordernar 1,2,3 vi W; int r1 = getLightest(1,2,3); int r2 = getMedian(1,2,3); W.push_back(r1);W.push_back(r2);W.push_back(6 - (r1 + r2)); // Passo 2 : inserir o 4 int r3 = getLightest(W[0],W[1],4); if(r3 == 4){ W.insert(W.begin(),4); } else{ int r4 = getNextLightest(W[0],W[1],W[2],4); if(r4 == W[0]){ W.push_back(4); } else if(r4 == W[1]){ W.insert(W.begin() + 1,4); } else{ W.insert(W.begin() + 2,4); } } // Passo 3 : inserir o 5 int r5 = getMedian(W[0],W[1],5); if(r5 == W[0]){ W.insert(W.begin(),5); } else if(r5 == 5){ W.insert(W.begin() + 1,5); } else{ int r6 = getMedian(W[2],W[3],5); if(r6 == W[2]){ W.insert(W.begin() + 2,5); } else if(r6 == 5){ W.insert(W.begin() + 3,5); } else{ W.push_back(5); } } // Passo 4 : inserir o 6 int r7 = getMedian(W[1],W[2],6); if(r7 == 6){ W.insert(W.begin() + 2,6); } else if(r7 == W[1]){ int r8 = getLightest(W[0],W[1],6); if(r8 == 6){ W.insert(W.begin(),6); } else{ W.insert(W.begin() + 1,6); } } else{ int r8 = getMedian(W[3],W[4],6); if(r8 == 6){ W.insert(W.begin() + 4,6); } else if(r8 == W[3]){ W.insert(W.begin() + 3,6); } else{ W.push_back(6); } } int A[6]; for(int i = 0;i<6;i++) A[i] = W[i]; answer(A); }

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:7:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T){
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...