| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1329753 | SulA | Scales (IOI15_scales) | C++20 | 0 ms | 0 KiB |
#include "scales.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
void init(int t) {}
//int getLightest(int a, int b, int c) {
// cout << a << " " << b << " " << c << endl;
// cin >> a;
// return a;
//}
void orderCoins() {
vector<int> rem = {1, 2, 3, 4, 5, 6};
int coins[6];
for (int p = 0; p < 6; p++) {
int mn = rem[0];
for (int i = 1; i+1 < 6 - p; i += 2) {
mn = getLightest(mn, rem[i], rem[i+1]);
}
if (rem.size() % 2 == 0)
mn = getLightest(mn, mn, rem.back());
coins[p] = mn;
auto pos = find(rem.begin(), rem.end(), mn);
swap(rem.back(), *pos);
rem.pop_back();
}
answer(coins);
// for (int x : coins) cout<<x<<" ";
}
int main() {
orderCoins();
}