제출 #595582

#제출 시각아이디문제언어결과실행 시간메모리
595582Apiram저울 (IOI15_scales)C++14
0 / 100
1 ms212 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { //1 2 3 4 5 6 // 5 - operations to get first and last value -> call median 4times then maximum or minimum 1 times // 2 - median call to get middle value // 3 call to do remaining // 10 calls to sort } //3 4 6 2 1 5 void orderCoins() { vector<bool>got(7,false); int a = getMedian(1, 2, 3); //2 got[a] = true; a = getMedian(4,5,6); got[a] = true; //6 for (int j = 0;j<2;++j){ vector<int>cur; for (int i = 1;i<7;++i){ if (!got[i]){ cur.push_back(i); //4 1 } } a = getMedian(cur[0],cur[1],cur[2]); got[a] = true; } vector<int>cur; for (int i = 1;i<7;++i){ if (!got[i]){ cur.push_back(i); } } a = getHeaviest(cur[0],cur[1],a); //3 1 5 int ans[6]; ans[5] = a;//5 if (a == cur[0]){ ans[0] = cur[1]; } else{ ans[0] = cur[0]; } // 3 cur.clear(); for (int i = 1;i<7;++i){ if (got[i])cur.push_back(i); } //2 6 4 - > 6 int b = getHeaviest(cur[0],cur[1],cur[2]); //6 1 5 a = getHeaviest(b,cur[3],ans[5]); ans[4] = a; got[a] = false; cur.clear(); for (int i = 1;i<7;++i){ if (!got[i])cur.push_back(i); } a = getHeaviest(cur[0],cur[1],cur[2]); ans[3] = a; got[a] = false; a = getMedian(cur[0],cur[1],cur[2]); got[a] = false; ans[2] = a; for (int i = 1;i<7;++i){ if(!got[i])ans[1] = i; } answer(ans); return; }

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

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