Submission #100058

# Submission time Handle Problem Language Result Execution time Memory
100058 2019-03-09T07:54:53 Z jamielim Broken Device (JOI17_broken_device) C++14
0 / 100
33 ms 904 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;i++){
        if(i<poss)continue;
        if(k>0){
            if(arr[i]!=-1){
                k--;
                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--;
            k=__builtin_ctz(X); X>>=k; k--;
        }
    }
    for(int i=0;i<N;i++){
        Set(i,max(0,arr[i]));
    }
    return;
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

long long Bruno( int N, int A[] ){
    long long ans=0;
    int k=0;
    for(int i=0;i<N;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 4 ms 748 KB Wrong Answer [3]
2 Incorrect 4 ms 640 KB Wrong Answer [3]
3 Incorrect 4 ms 748 KB Wrong Answer [3]
4 Incorrect 5 ms 776 KB Wrong Answer [3]
5 Incorrect 4 ms 776 KB Wrong Answer [3]
6 Incorrect 33 ms 640 KB Wrong Answer [3]
7 Incorrect 4 ms 776 KB Wrong Answer [3]
8 Incorrect 4 ms 640 KB Wrong Answer [3]
9 Incorrect 4 ms 640 KB Wrong Answer [3]
10 Incorrect 6 ms 640 KB Wrong Answer [3]
11 Incorrect 5 ms 640 KB Wrong Answer [3]
12 Incorrect 5 ms 640 KB Wrong Answer [3]
13 Incorrect 4 ms 768 KB Wrong Answer [3]
14 Incorrect 4 ms 640 KB Wrong Answer [3]
15 Incorrect 4 ms 724 KB Wrong Answer [3]
16 Incorrect 4 ms 640 KB Wrong Answer [3]
17 Incorrect 3 ms 640 KB Wrong Answer [3]
18 Incorrect 4 ms 640 KB Wrong Answer [3]
19 Incorrect 3 ms 636 KB Wrong Answer [3]
20 Incorrect 4 ms 776 KB Wrong Answer [3]
21 Incorrect 4 ms 768 KB Wrong Answer [3]
22 Incorrect 5 ms 640 KB Wrong Answer [3]
23 Incorrect 5 ms 640 KB Wrong Answer [3]
24 Incorrect 4 ms 796 KB Wrong Answer [3]
25 Incorrect 4 ms 640 KB Wrong Answer [3]
26 Incorrect 4 ms 640 KB Wrong Answer [3]
27 Incorrect 4 ms 776 KB Wrong Answer [3]
28 Incorrect 5 ms 768 KB Wrong Answer [3]
29 Incorrect 2 ms 888 KB Wrong Answer [3]
30 Incorrect 4 ms 768 KB Wrong Answer [3]
31 Incorrect 7 ms 776 KB Wrong Answer [3]
32 Incorrect 4 ms 640 KB Wrong Answer [3]
33 Incorrect 5 ms 636 KB Wrong Answer [3]
34 Incorrect 5 ms 640 KB Wrong Answer [3]
35 Incorrect 4 ms 868 KB Wrong Answer [3]
36 Incorrect 3 ms 640 KB Wrong Answer [3]
37 Incorrect 5 ms 880 KB Wrong Answer [3]
38 Incorrect 4 ms 640 KB Wrong Answer [3]
39 Incorrect 4 ms 904 KB Wrong Answer [3]
40 Incorrect 5 ms 876 KB Wrong Answer [3]