제출 #345037

#제출 시각아이디문제언어결과실행 시간메모리
345037pggp저울 (IOI15_scales)C++14
45.45 / 100
1 ms384 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int T){ } void orderCoins(){ int ans[6]; int a[3]; int b[3]; a[0] = getHeaviest(1, 2, 3); b[0] = getHeaviest(4, 5, 6); a[1] = getMedian(1, 2, 3); b[1] = getMedian(4, 5, 6); a[2] = 6 / a[0] / a[1]; b[2] = 120 / b[0] / b[1]; int a_used = 0; int b_used = 0; int cur = 5; while(true){ //cout << cur << " a_ised = " << a_used << " b_used = " << b_used << endl; int x; if(a_used < 2) x = a[0]; if(b_used < 2) x = b[0]; ans[cur] = getLightest(a[2 - a_used], b[2 - b_used], x); if(ans[cur] == a[2 - a_used]){ a_used++; } else{ b_used++; } if(a_used == 2 and b_used == 2){ ans[1] = getMedian(a[0], b[0], a[2]); if(ans[1] == a[0]){ ans[0] = b[0]; } else{ ans[0] = a[0]; } break; } if(a_used == 3){ if(b_used == 0){ ans[0] = b[0]; ans[1] = b[1]; ans[2] = b[2]; break; } if(b_used == 1){ ans[0] = b[0]; ans[1] = b[1]; break; } } if(b_used == 3){ if(a_used == 0){ ans[0] = a[0]; ans[1] = a[1]; ans[2] = a[2]; break; } if(a_used == 1){ ans[0] = a[0]; ans[1] = a[1]; break; } } cur--; } int ans1[6]; for (int i = 0; i < 6; ++i) { ans1[i] = ans[5 - i]; } answer(ans1); }

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

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