| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 589795 | MilosMilutinovic | 저울 (IOI15_scales) | C++14 | 1 ms | 224 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
* author: wxhtzdy
* created: 05.07.2022 11:10:33
**/
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int tt) {
return;
}
void orderCoins() {
int ans[6];
int L0 = getLightest(1, 2, 3); // 3
int R0 = getLightest(4, 5, 6); // 4
int L1 = getMedian(1, 2, 3); // 2
int R1 = getMedian(4, 5, 6); // 6
int L2 = (1 ^ 2 ^ 3 ^ L0 ^ L1); // 1
int R2 = (4 ^ 5 ^ 6 ^ R0 ^ R1); // 5
int mn = getLightest(L0, R0, L1); // 3
ans[0] = mn; // 3
ans[1] = (mn ^ L0 ^ R0); // 4
ans[2] = L1; // 2
ans[3] = R1; // 6
ans[4] = L2; // 1
ans[5] = R2; // 5
for (int i = 0; i < 3; i++) {
int idx = getNextLightest(ans[i + 1], ans[i + 2], ans[i + 3], ans[i]); // 4
if (ans[i + 2] == idx) {
swap(ans[i + 1], ans[i + 2]);
} else if (ans[i + 3] == idx) {
swap(ans[i + 2], ans[i + 3]);
swap(ans[i + 1], ans[i + 2]);
}
}
if (getHeaviest(ans[3], ans[4], ans[5]) == ans[4]) {
swap(ans[4], ans[5]);
}
answer(ans);
return;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
