# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
936673 | PagodePaiva | 저울 (IOI15_scales) | C++17 | 1 ms | 440 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T) {
/* ... */
}
void triple(vector <int> &v){
int a = getHeaviest(v[0], v[1], v[2]);
int b = getMedian(v[0], v[1], v[2]);
int c;
for(auto x : v){
if(x == a) continue;
if(x == b) continue;
c = x;
break;
}
v = {a, b, c};
return;
}
void orderCoins() {
vector <int> v1 = {1, 2, 3};
vector <int> v2 = {4, 5, 6};
triple(v1);
triple(v2);
int x = getLightest(v1[2], v2[2], v1[1]);
vector <int> res;
if(x == v1[2]){
res.push_back(x);
v1.pop_back();
}
else{
res.push_back(x);
v2.pop_back();
}
while(!v1.empty() and !v2.empty()){
x = getMedian(res.back(), v1.back(), v2.back());
if(x == v1.back()) v1.pop_back();
else v2.pop_back();
res.push_back(x);
}
while(!v1.empty()){
res.push_back(v1.back());
v1.pop_back();
}
while(!v2.empty()){
res.push_back(v2.back());
v2.pop_back();
}
int w[6];
int i = 5;
for(auto x : res){
w[i] = x;
i--;
}
answer(w);
return;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |