# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357951 | beksultan04 | Scales (IOI15_scales) | C++14 | 1 ms | 492 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"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
void init(int T) {
ret ;
/* ... */
}
int vis[40];
void orderCoins() {
/* ... */
int i;
vector <int> v(6);
{
int a = getLightest(1,2,3);
int b = getLightest(4,5,6);
int c;
if (a == 1)
c = getLightest(a,2,b);
else
c = getLightest(a,1,b);
vis[b] = vis[a]=1;
if (c == a){
v[0] = a;
v[1] = b;
}
else {
v[1] = a;
v[0] = b;
}
}
{
int a = getHeaviest(1,2,3);
int b = getHeaviest(4,5,6);
int c;
if (a == 1)
c = getHeaviest(a,2,b);
else
c = getHeaviest(a,1,b);
vis[b] = vis[a]=1;
if (c == a){
v[5] = a;
v[4] = b;
}
else {
v[4] = a;
v[5] = b;
}
}
{
int a = 1;
while (vis[a])a++;
int b = a;
vis[a] = 1;
while (vis[b])b++;
int c = getMedian(v[0],a,b);
if (c == a){
v[2] = a;
v[3] = b;
}
else {
v[3] = a;
v[2] = b;
}
}
int W[6];
for (i=0;i<6;++i){
W[i] = v[i];
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |