# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
110973 | aleksam | Bali Sculptures (APIO15_sculpture) | C++14 | 83 ms | 504 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.
//Apio 15 structures
#include <bits/stdc++.h>
#define INF INT_MAX
#define MOD 100000007
#define MAX_N 2019
using namespace std;
int A, B, N;
int a[MAX_N];
unsigned long long s[MAX_N];
int fs[MAX_N], ls[MAX_N];
bool bfs(unsigned long long n){//vraca moze ne moze
memset(fs, -1, sizeof(fs));
memset(ls, -1, sizeof(ls));
fs[0]=ls[0]=0;//pusti grane iz nule
for(int i=1; i<=N; ++i){
if((s[i-1]|n)==n){
fs[i]=fs[0]+1;
ls[i]=ls[0]+1;
//printf("Digao sam %d iz 0", i);
}
}
for(int i=1; i<N; ++i){
if(fs[i]==-1)continue;
//pustamo grane iz i
for(int j=i+1; j<=N; ++j){
if(((s[j-1]-s[i-1])|n)==n){
if(fs[j]>fs[i]+1 || fs[j]==-1)fs[j]=fs[i]+1;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |