제출 #685169

#제출 시각아이디문제언어결과실행 시간메모리
685169APROHACK저울 (IOI15_scales)C++14
46.02 / 100
1 ms224 KiB
#include "scales.h" #include <bits/stdc++.h> #define pb push_back #define ll long long using namespace std; set<int>restantes; vector<int>r; int respuestas[4][6][6][6][6]; int mayor(int a, int b, int c){ //cout << "llegó " << a << " " << b << " " << c << endl; if(respuestas[0][a][b][c][0] != -1 )return respuestas[0][a][b][c][0]; else return respuestas[0][a][b][c][0] = getHeaviest(a, b, c); } void init(int T) { } void reiniciar(){ for(int i = 1 ; i <= 6 ; i ++)restantes.insert(i); memset(respuestas, -1 , sizeof respuestas); } void getRestantesEnORden(){ r.clear(); //cout << "reiniciando " << endl; for(auto i : restantes){ r.pb(i); //cout << i << " " ; } //cout << endl; } void orderCoins() { /* ... */ reiniciar(); int W[] = {1, 2, 3, 4, 5, 6}; getRestantesEnORden(); int a = mayor(r[0], r[1], r[2]); int b = mayor(r[3], r[4], r[5]); W[5] = mayor(a, b, (r[0] == a ? r[1] : r[0])); restantes.erase(W[5]); getRestantesEnORden(); a = mayor(r[0], r[1], r[2]); W[4] = mayor(a, r[3], r[4]); restantes.erase(W[4]); getRestantesEnORden(); a = mayor(r[0], r[1], r[2]); W[3] = mayor(a, r[3], (r[0] == a ? r[1] : r[0])); restantes.erase(W[3]); getRestantesEnORden(); W[2] = mayor(r[0], r[1], r[2]); W[1] = getMedian(r[0], r[1], r[2]); restantes.erase(W[2]); restantes.erase(W[1]); getRestantesEnORden(); W[0] = r[0]; answer(W); }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'void init(int)':
scales.cpp:18:15: warning: unused parameter 'T' [-Wunused-parameter]
   18 | void init(int T) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...