# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
784894 | aZvezda | Scales (IOI15_scales) | C++14 | 1096 ms | 38720 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;
typedef long long ll;
#ifndef LOCAL
#define cerr if(false)cerr
#endif
const ll MAX_N = 20;
vector<ll> all;
ll dp[1 << MAX_N];
pair<ll, pair<pair<ll, ll>, pair<ll, ll> > > hist[1 << MAX_N];
bool valid(ll curr, ll a, ll b) {
while(curr % 8 != b) {
if(curr % 8 == a) {
return false;
}
curr /= 8;
}
return true;
}
vector<ll> eliminate(const vector<ll> &curr, ll a, ll b) {
vector<ll> ret = {};
for(const auto it : curr) {
if(valid(it, a, b)) {
ret.push_back(it);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |