# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
345034 | pggp | 저울 (IOI15_scales) | C++14 | 1 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T){
}
void orderCoins(){
vector < int > ans;
vector < int > to_do;
to_do.push_back(1);
to_do.push_back(2);
to_do.push_back(3);
to_do.push_back(4);
to_do.push_back(5);
to_do.push_back(6);
while(!to_do.empty()){
if(to_do.size() == 3){
int a = getHeaviest(to_do[0], to_do[1], to_do[2]);
int b = getMedian(to_do[0], to_do[1], to_do[2]);
int c = getLightest(to_do[0], to_do[1], to_do[2]);
ans.push_back(a);
ans.push_back(b);
ans.push_back(c);
break;
}
else{
int h = getHeaviest(to_do[0], to_do[1], to_do[2]);
int m = getMedian(to_do[0], to_do[1], to_do[2]);
for (int i = 3; i < to_do.size(); ++i)
{
h = getHeaviest(h, m, to_do[i]);
}
ans.push_back(h);
int ind;
for (int i = 0; i < to_do.size(); ++i)
{
if(to_do[i] == h){
ind = i;
}
}
to_do.erase(to_do.begin() + ind);
}
}
int ans1[6];
for (int i = 0; i < 6; ++i)
{
ans1[i] = ans[5 - i];
}
answer(ans1);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |