# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
93467 | tincamatei | 저울 (IOI15_scales) | C++14 | 14 ms | 508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include "scales.h"
void init(int T) {
/* ... */
}
void eraseVector(int val, std::vector<int> &x) {
int i = 0;
while(x[i] != val)
++i;
x.erase(x.begin() + i);
}
void orderCoins() {
int w[6];
std::vector<int> x{1, 2, 3, 4, 5, 6};
int lgt = getLightest(x[0], getLightest(x[0], x[1], x[2]), getLightest(x[3], x[4], x[5]));
w[0] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
lgt = getLightest(lgt, x[3], x[4]);
w[1] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
if(x[0] != lgt) lgt = getLightest(x[3], lgt, x[0]);
else lgt = getLightest(x[3], lgt, x[1]);
w[2] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
w[3] = lgt;
lgt = getMedian(x[0], x[1], x[2]);
w[4] = lgt;
w[5] = x[0] + x[1] + x[2] - w[3] - w[4];
answer(w);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |