# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299411 | Pichon5 | Scales (IOI15_scales) | C++17 | 1 ms | 288 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>
#define vi vector<int>
#define pb push_back
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
vector<int>res;
vector<bool>vis;
vis.assign(7,false);
//-----
int a= getLightest(1,2,3);
int b= getLightest(4,5,6);
int c=1;
if(a==c){
c=2;
}
a=getLightest(a,b,c);
res.pb(a);
vis[a]=true;
//------
vector<int>v;
v.clear();
for(int i=1;i<=6;i++){
if(vis[i]==false){
v.push_back(i);
}
}
a=getLightest(v[0],v[1],v[2]);
b=getLightest(a,v[3],v[4]);
res.pb(b);
vis[b]=true;
//---------
v.clear();
for(int i=1;i<=6;i++){
if(vis[i]==false){
v.push_back(i);
}
}
a=getLightest(v[0],v[1],v[2]);
b=v[0];
if(a==b){
b=v[1];
}
c=getLightest(a,b,v[3]);
vis[c]=true;
res.pb(c);
//------------
v.clear();
for(int i=1;i<=6;i++){
if(vis[i]==false){
v.push_back(i);
}
}
a=getLightest(v[0],v[1],v[2]);
vis[a]=true;
res.pb(a);
//------------
v.clear();
for(int i=1;i<=6;i++){
if(vis[i]==false){
v.push_back(i);
}
}
a=getMedian(res[0],v[0],v[1]);
res.pb(a);
vis[a]=true;
for(int i=1;i<=6;i++){
if(vis[i]==false){
res.pb(i);
break;
}
}
int W[6];
for(int i=0;i<6;i++){
W[i]=res[i];
}
answer(W);
return ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |