# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
11578 | gs14004 | Sequence (BOI14_sequence) | C++98 | 432 ms | 33040 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 <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int n;
long long res = 1e16, p[17];
void solve(int *bit, int sz, long long cb, int depth, int had_zero){
if(cb >= res) return;
if(sz == 1){
int r = bit[0];
if(r == 0){
if(cb == 0 || had_zero) cb += p[depth];
}
else if(r == 1){
cb += p[depth] * 10;
}
else{
if(r&1){
int minima = 1e9;
for (int i=9; i; i--) {
if((r>>i)&1) minima = i;
}
for (int i=9; i; i--) {
if((r>>i)&1 && i != minima){
cb += p[depth] * i;
depth++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |