제출 #64230

#제출 시각아이디문제언어결과실행 시간메모리
64230IvanC저울 (IOI15_scales)C++17
55.90 / 100
5 ms544 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; void init(int T){ // printf("T %d casos de teste\n",T); } void orderCoins(){ // printf("Oi\n"); // Passo 1 : ordernar 1,2,3 vi W; int r1 = getLightest(1,2,3); //printf("Meu primeiro resultado %d\n",r1); int r2 = getMedian(1,2,3); //printf("Meu segundo resultado %d\n",r2); W.push_back(r1);W.push_back(r2);W.push_back(6 - (r1 + r2)); // Passo 2 : inserir o 4 int r3 = getMedian(W[0],W[1],4); if(r3 == W[0]){ vi A = {4,W[0],W[1],W[2]}; W = A; } else if(r3 == 4){ vi A = {W[0],4,W[1],W[2]}; W = A; } else{ int r4 = getHeaviest(W[0],W[2],4); if(r4 == 4){ W.push_back(4); } else{ vi A = {W[0],W[1],4,W[2]}; W = A; } } // Passo 3 : inserir o 5 int r5 = getMedian(W[0],W[1],5); if(r5 == W[0]){ vi A = {5,W[0],W[1],W[2],W[3]}; W = A; } else if(r5 == 5){ vi A = {W[0],5,W[1],W[2],W[3]}; W = A; } else{ int r6 = getMedian(W[2],W[3],5); if(r6 == W[2]){ vi A = {W[0],W[1],5,W[2],W[3]}; W = A; } else if(r6 == 5){ vi A = {W[0],W[1],W[2],5,W[3]}; W = A; } else{ W.push_back(5); } } // Passo 4 : inserir o 6 int r7 = getMedian(W[1],W[2],6); if(r7 == 6){ vi A = {W[0],W[1],6,W[2],W[3],W[4]}; W = A; } else if(r7 == W[1]){ int r8 = getLightest(W[0],W[1],6); if(r8 == 6){ vi A = {6,W[0],W[1],W[2],W[3],W[4]}; W = A; } else{ vi A = {W[0],6,W[1],W[2],W[3],W[4]}; W = A; } } else{ int r8 = getMedian(W[3],W[4],6); if(r8 == 6){ vi A = {W[0],W[1],W[2],W[3],6,W[4]}; W = A; } else if(r8 == W[3]){ vi A = {W[0],W[1],W[2],6,W[3],W[4]}; W = A; } else{ W.push_back(6); } } int ANS[6]; for(int i = 0;i<6;i++) ANS[i] = W[i]; answer(ANS); }

컴파일 시 표준 에러 (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...