# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
59621 | reality | Scales (IOI15_scales) | C++17 | 3 ms | 768 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;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
//getHeaviest
//getLightest
//getMedian
//getNextLightest
void init(int T) {
return;
}
/*int dp[1 << 24];
int fr[1 << 24];
const int N = 14348907;
const int p3[] = {1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969};
*/
int h[33][33];
void orderCoins() {
for (int i = 1;i <= 6;++i)
for (int j = i + 1;j <= 6;++j) {
int k = 1;
while (k == i || k == j)
++k;
int a = getLightest(i,j,k);
int b = getMedian(i,j,k);
int c = i + j + k - a - b;
if (i == a || (i == b && j == c))
h[i][j] = 1;
else
h[j][i] = 1;
}
vi p(6);
for (int i = 0;i < 6;++i)
p[i] = i + 1;
sort(all(p),[&](int x,int y) {
return h[x][y];
});
answer(p.data());
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |