# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
715809 | adamjinwei | Scales (IOI15_scales) | C++14 | 1 ms | 340 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 <bits/stdc++.h>
#include "scales.h"
#define inf 1000000007
#define mod 1000000007
// #define int long long
// #pragma GCC optimize("Ofast","inline","-ffast-math")
// #pragma GCC target("avx,sse2,sse3,sse4,mmx")
using namespace std;
template <typename T> void read(T &x){
x=0;char ch=getchar();int fh=1;
while (ch<'0'||ch>'9'){if (ch=='-')fh=-1;ch=getchar();}
while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
x*=fh;
}
template <typename T> void write(T x) {
if (x<0) x=-x,putchar('-');
if (x>9) write(x/10);
putchar(x%10+'0');
}
template <typename T> void writeln(T x) {
write(x);
puts("");
}
void init(int tc)
{
}
void orderCoins()
{
vector<int> cur,ans;
for(int i=1;i<=6;++i)
cur.push_back(i);
int mn=getLightest(getLightest(cur[0],cur[1],cur[2]),cur[3],cur[4]);
mn=getLightest(mn,cur[5],(cur[0]==mn?cur[1]:cur[0]));
ans.push_back(mn);cur.erase(find(cur.begin(),cur.end(),mn));
mn=getLightest(getLightest(cur[0],cur[1],cur[2]),cur[3],cur[4]);
ans.push_back(mn);cur.erase(find(cur.begin(),cur.end(),mn));
mn=getLightest(cur[0],cur[1],cur[2]);
mn=getLightest(mn,cur[3],(cur[0]==mn?cur[1]:cur[0]));
ans.push_back(mn);cur.erase(find(cur.begin(),cur.end(),mn));
mn=getLightest(cur[0],cur[1],cur[2]);
ans.push_back(mn);
int mid=getMedian(cur[0],cur[1],cur[2]);
ans.push_back(mid);
cur.erase(find(cur.begin(),cur.end(),mn));
cur.erase(find(cur.begin(),cur.end(),mid));
ans.push_back(cur[0]);
int W[6];
for(int i=0;i<6;++i) W[i]=ans[i];
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |