Submission #100077

# Submission time Handle Problem Language Result Execution time Memory
100077 2019-03-09T08:14:29 Z helloworldworld Broken Device (JOI17_broken_device) C++14
0 / 100
2000 ms 904 KB
#include "Annalib.h"

void Anna( int n, long long x, int k, int p[] ){
    int num[65];
    int c=0;
    int s,e;
    while(x!=0){
        num[c]=x%2;
        x/=2;
        c++;
    }
    int cur=0;
    for(int i=0;i<k&&cur<c;i++){
        if(i==0) s=0;
        else s=p[i-1]+1;
        e=p[i];
        Set(e,0);
        if(e-s<1) continue;
        if(e-s==1){
            if(num[cur]==1){
                Set(s,1);
                s++;
            }
            else{
                Set(s,0);
                s++;
            }
        }
        else{
            while(e-s>=num[cur]+1&&cur<c){
                if(num[cur]==0){
                    Set(s,1);
                    Set(s+1,1);
                    s+=2;
                    cur++;
                }
                
            }
            if(e-s==1)
                Set(s,0);
        }

    }
    int now;
    
    return;
}

#include "Brunolib.h"

long long Bruno( int n, int a[] ){
    long long ans=0;
    long long p=1;
    for(int i=0;i<n;i++){
        if(a[i]==1){
            if(i<n-1){
                if(a[i+1]==1){
                    ans+=0;
                    p*=2;
                    i++;
                }
                else{
                    ans+=p;
                    p*=2;
                }
            }
            else{
                ans+=p;
                p*=2;
            }
        }
    }
    return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:44:9: warning: unused variable 'now' [-Wunused-variable]
     int now;
         ^~~
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 300 KB Time limit exceeded
2 Incorrect 3 ms 640 KB Wrong Answer [4]
3 Incorrect 4 ms 776 KB Wrong Answer [4]
4 Execution timed out 2065 ms 256 KB Time limit exceeded
5 Execution timed out 2055 ms 256 KB Time limit exceeded
6 Execution timed out 2029 ms 256 KB Time limit exceeded
7 Incorrect 4 ms 640 KB Wrong Answer [4]
8 Incorrect 4 ms 780 KB Wrong Answer [4]
9 Execution timed out 2062 ms 256 KB Time limit exceeded
10 Execution timed out 2044 ms 256 KB Time limit exceeded
11 Execution timed out 2054 ms 256 KB Time limit exceeded
12 Execution timed out 2036 ms 256 KB Time limit exceeded
13 Incorrect 4 ms 640 KB Wrong Answer [4]
14 Incorrect 4 ms 904 KB Wrong Answer [4]
15 Execution timed out 2051 ms 384 KB Time limit exceeded
16 Execution timed out 2021 ms 252 KB Time limit exceeded
17 Execution timed out 2027 ms 400 KB Time limit exceeded
18 Execution timed out 2015 ms 256 KB Time limit exceeded
19 Execution timed out 2032 ms 256 KB Time limit exceeded
20 Execution timed out 2036 ms 256 KB Time limit exceeded
21 Incorrect 4 ms 748 KB Wrong Answer [4]
22 Execution timed out 2032 ms 256 KB Time limit exceeded
23 Execution timed out 2027 ms 256 KB Time limit exceeded
24 Incorrect 5 ms 768 KB Wrong Answer [4]
25 Incorrect 5 ms 768 KB Wrong Answer [4]
26 Incorrect 4 ms 776 KB Wrong Answer [4]
27 Incorrect 5 ms 640 KB Wrong Answer [4]
28 Execution timed out 2033 ms 256 KB Time limit exceeded
29 Execution timed out 2043 ms 412 KB Time limit exceeded
30 Execution timed out 2056 ms 256 KB Time limit exceeded
31 Incorrect 6 ms 804 KB Wrong Answer [4]
32 Execution timed out 2045 ms 256 KB Time limit exceeded
33 Execution timed out 2049 ms 256 KB Time limit exceeded
34 Execution timed out 2039 ms 256 KB Time limit exceeded
35 Incorrect 4 ms 640 KB Wrong Answer [4]
36 Execution timed out 2049 ms 256 KB Time limit exceeded
37 Execution timed out 2048 ms 256 KB Time limit exceeded
38 Execution timed out 2023 ms 256 KB Time limit exceeded
39 Execution timed out 2027 ms 256 KB Time limit exceeded
40 Execution timed out 2069 ms 256 KB Time limit exceeded