Submission #100070

# Submission time Handle Problem Language Result Execution time Memory
100070 2019-03-09T08:04:16 Z jamielim Broken Device (JOI17_broken_device) C++14
0 / 100
60 ms 3328 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
    int arr[N];
    for(int i=0;i<K;i++){
        arr[P[i]]=-1;
    }
    int poss=0;
    int k=__builtin_ctz(X);
    X>>=k;
    for(int i=0;i<N-1;i++){
        if(X==0)break;
        if(i<poss)continue;
        if(X%2==0){
            if(arr[i]!=-1){
                arr[i]=1;
                arr[i+1]=0;
                poss=i+2;
            }
        }else{
            if(arr[i]!=-1&&arr[i+1]!=-1){
                arr[i]=1;
                arr[i+1]=1;
                poss=i+2;
            }
        }
        X>>=1;
    }
    for(int i=0;i<N;i++){
        if(arr[i]!=1&&arr[i]!=0)arr[i]=0;
        Set(i,arr[i]);
    }
    return;
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

long long Bruno( int N, int A[] ){
    long long ans=0;
    long long k=0;
    for(int i=0;i<N-1;i++){
        if(A[i]==1&&A[i+1]==1){
            ans+=(1<<k);
            k++;
            i++;
        }else if(A[i]==1&&A[i+1]==0){
            k++;
        }
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
2 Incorrect 40 ms 3064 KB Output isn't correct - L* = 0
3 Incorrect 46 ms 3008 KB Output isn't correct - L* = 0
4 Incorrect 48 ms 3072 KB Output isn't correct - L* = 0
5 Incorrect 44 ms 3056 KB Output isn't correct - L* = 0
6 Incorrect 40 ms 3064 KB Output isn't correct - L* = 0
7 Incorrect 43 ms 2984 KB Output isn't correct - L* = 0
8 Incorrect 43 ms 3040 KB Output isn't correct - L* = 0
9 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 56 ms 3072 KB Output isn't correct - L* = 0
11 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
12 Incorrect 40 ms 2856 KB Output isn't correct - L* = 0
13 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 41 ms 3072 KB Output isn't correct - L* = 0
15 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
16 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
17 Incorrect 60 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 42 ms 3056 KB Output isn't correct - L* = 0
19 Incorrect 41 ms 2936 KB Output isn't correct - L* = 0
20 Incorrect 38 ms 3000 KB Output isn't correct - L* = 0
21 Incorrect 55 ms 3072 KB Output isn't correct - L* = 0
22 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
23 Incorrect 40 ms 3000 KB Output isn't correct - L* = 0
24 Incorrect 45 ms 3072 KB Output isn't correct - L* = 0
25 Incorrect 52 ms 3072 KB Output isn't correct - L* = 0
26 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
27 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
28 Incorrect 38 ms 3016 KB Output isn't correct - L* = 0
29 Incorrect 59 ms 3056 KB Output isn't correct - L* = 0
30 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
31 Incorrect 41 ms 3328 KB Output isn't correct - L* = 0
32 Incorrect 37 ms 3072 KB Output isn't correct - L* = 0
33 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
34 Incorrect 46 ms 3000 KB Output isn't correct - L* = 0
35 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
36 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
37 Incorrect 41 ms 2984 KB Output isn't correct - L* = 0
38 Incorrect 41 ms 3208 KB Output isn't correct - L* = 0
39 Incorrect 41 ms 3008 KB Output isn't correct - L* = 0
40 Incorrect 42 ms 3072 KB Output isn't correct - L* = 0