# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
550419 | elazarkoren | 저울 (IOI15_scales) | C++17 | 1 ms | 224 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "scales.h"
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
void init(int T) {
}
map<vi, int> asks;
int queryLight(int a, int b, int c) {
vi v = {a, b, c};
sort(all(v));
// if (asks.count(v)) return asks[v];
return asks[v] = getLightest(a, b, c);
}
void orderCoins() {
int w[] = {1, 2, 3, 4, 5, 6};
while (true) {
bool b = false;
for (int i = 0; i < 4; i++) {
int x = queryLight(w[i], w[i + 1], w[i + 2]);
if (x != w[i]) {
b = true;
}
for (int j = i + 1; j < i + 3; j++) {
if (x == w[j]) {
swap(w[i], w[j]);
break;
}
}
}
if (!b) break;
}
int x = getMedian(w[3], w[4], w[5]);
if (x != w[4]) swap(w[4], w[5]);
answer(w);
}
//1
//3 4 6 2 1 5
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |