# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
619623 | Mounir | Scales (IOI15_scales) | C++14 | 2 ms | 468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "scales.h"
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define chmax(x, v) x = max(x, v)
#define chmin(x, v) x = min(x, v)
#define pii pair<int, int>
#define pb push_back
#define sz(x) (int)x.size()
#define x first
#define y second
//#define int long long
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
int W[6];
set<int> reste = {1, 2, 3, 4, 5, 6};
for (int i = 0; i < 4; ++i){
int mini = *reste.begin();
vector<int> file;
for (int a : reste)
file.pb(a);
reverse(all(file));
file.pop_back();
reverse(all(file));
int pasMini = -1;
for (int i = 0; i < sz(file); i += 2){
int avant = mini;
if (i + 1 < sz(file)) {
mini = getLightest(mini, file[i], file[i + 1]);
for (int j : {i, i + 1}){
if (mini != j)
pasMini = j;
}
if (avant != mini)
pasMini = avant;
}
else
mini = getLightest(mini, pasMini, file[i]);
}
reste.erase(mini);
W[i] = mini;
}
int a = *reste.begin();
reste.erase(reste.begin());
int b = *reste.begin();
W[5] = getHeaviest(W[0], a, b);
W[4] = a;
if (W[5] == W[4])
W[4] = b;
answer(W);
return;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |