| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 668505 | LittleCube | Scales (IOI15_scales) | C++17 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "scales.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void init(int T)
{
}
/*
int getMedian(int A, int B, int C);
int getHeaviest(int A, int B, int C);
int getLightest(int A, int B, int C);
int getNextLightest(int A, int B, int C, int D);
*/
void orderCoins()
{
deque<int> v1(3), v2(3);
v1[0] = getLightest(1, 2, 3);
v1[1] = getMedian(1, 2, 3);
v1[2] = v1[0] ^ v1[1];
v2[0] = getLightest(4, 5, 6);
v2[1] = getMedian(4, 5, 6);
v2[2] = ((v2[0] - 3) ^ (v2[1] - 3)) + 3;
int ans[6], i = 0;
for (; i < 3; i++)
{
ans[i] = getLightest(v1[0], v1[1], v2[0]);
if (ans[i] == v1[0])
v1.pop_front();
else
v2.pop_front();
if (v1.size() < v2.size())
swap(v1, v2);
}
if (v2.empty())
{
ans[3] = v1[0];
ans[4] = v1[1];
ans[5] = v1[2];
}
else
{
i--;
int res = getNextLightest(ans[i], v1[0], v1[1], v2[0]);
if (res == ans[i])
{
ans[3] = v1[0];
ans[4] = v1[1];
ans[5] = v2[0];
}
else if (res == v1[0])
{
ans[3] = v2[0];
ans[4] = v1[0];
ans[5] = v1[1];
}
else
{
ans[3] = v1[0];
ans[4] = v2[0];
ans[5] = v1[1];
}
}
answer(ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
