# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1101182 | Aviansh | Scales (IOI15_scales) | C++17 | 1 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {
}
void placemin(int W[], int st){
//cout << "getting lightest in : " << W[st] << " " << W[st+1] << " " << W[st+2] << "\n";
int a = getLightest(W[st],W[st+1],W[st+2]);
//cout << a << "\n";
if(a==W[st+1]){
//cout << "swapped" << st+1 << " " << st << "\n";
swap(W[st+1],W[st]);
}
if(a==W[st+2]){
//cout << "swapped" << st+2 << " " << st << "\n";
swap(W[st+2],W[st]);
}
for(int i = 0;i<6;i++){
//cout << W[i] << " ";
}
//cout << "\n";
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
placemin(W,3);
placemin(W,2);
placemin(W,1);
placemin(W,0);
placemin(W,3);
placemin(W,2);
placemin(W,1);
placemin(W,3);
placemin(W,2);
placemin(W,3);
int a = getHeaviest(W[3],W[4],W[5]);
if(W[5]!=a){
swap(W[4],W[5]);
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |