# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
419800 | Pbezz | Scales (IOI15_scales) | C++14 | 1 ms | 256 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>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
typedef pair<ll,ll> pii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const ll MAXN = 2e5+5;
const ll INF = 1e15+7;
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
int m1,m2,m,i,j;
m1 = getLightest(1,2,3);
m2 = getLightest(4,5,6);
if(m1==1){
m = getLightest(m1,m2,2);
}else{
m = getLightest(m1,m2,1);
}
swap(W[m-1],W[0]);
for(i=1;i<5;i++){
for(j=2;j<6-i+1;j++){
if(getMedian(W[0],W[j-1],W[j])==W[j]){
swap(W[j],W[j-1]);
}
}
}
answer(W);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |