# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57114 | qkxwsm | Scales (IOI15_scales) | C++17 | 4 ms | 656 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;
template<class T>
void readi(T &x)
{
T input = 0;
bool negative = false;
char c = ' ';
while (c < '-')
{
c = getchar();
}
if (c == '-')
{
negative = true;
c = getchar();
}
while (c >= '0')
{
input = input * 10 + (c - '0');
c = getchar();
}
if (negative)
{
input = -input;
}
x = input;
}
template<class T>
void printi(T output)
{
if (output == 0)
{
putchar('0');
return;
}
if (output < 0)
{
putchar('-');
output = -output;
}
int aout[20];
int ilen = 0;
while(output)
{
aout[ilen] = ((output % 10));
output /= 10;
ilen++;
}
for (int i = ilen - 1; i >= 0; i--)
{
putchar(aout[i] + '0');
}
return;
}
template<class T>
void ckmin(T &a, T b)
{
a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
a = max(a, b);
}
long long randomize(long long mod)
{
return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}
#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-20;
#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
long long normalize(long long x, long long mod = INF)
{
return (((x % mod) + mod) % mod);
}
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int ans[6];
void init(int T)
{
/* ... */
}
void orderCoins()
{
for (int i = 0; i < 6; i++)
{
ans[i] = i;
}
// for (int i = 1; i < 6; i++)
// {
// bool swap = false;
// for (int j = 0; j < 4; j++)
// {
// int lo = getLightest(ans[j], ans[j + 1], ans[j + 2]);
// int hi = getHeaviest(ans[j], ans[j + 1], ans[j + 2]);
// int mid;
// if (lo != ans[j] || hi != ans[j + 2]) swap = true;
// if (ans[j] != lo && ans[j] != hi) mid = ans[j];
// if (ans[j + 1] != lo && ans[j + 1] != hi) mid = ans[j + 1];
// if (ans[j + 2] != lo && ans[j + 2] != hi) mid = ans[j + 2];
// ans[j] = lo;
// ans[j + 1] = mid;
// ans[j + 2] = hi;
// }
// if (!swap)
// {
// break;
// }
// }
for (int i = 0; i < 6; i++)
{
ans[i]++;
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |