Submission #954908

# Submission time Handle Problem Language Result Execution time Memory
954908 2024-03-28T19:23:32 Z efishel Broken Device (JOI17_broken_device) C++17
8 / 100
30 ms 2660 KB
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;

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

long long Bruno(int N, int A[]){
    
    long long res=0, p=60, vis[200]; 
    for(int i=0; i<N; i++)vis[i]=0;
    
    for(int i=0; i<N; i++){
        if(p<0)break;
        if(vis[i]==1 || A[i]==0)continue;
        if(A[i+1]) {
            res+=1ll<<p;
            vis[i+1]=1;
        }
        p--;
    }
    
    return res;
}
# Verdict Execution time Memory Grader output
1 Partially correct 26 ms 2596 KB Output is partially correct - L* = 15
2 Partially correct 25 ms 2396 KB Output is partially correct - L* = 15
3 Partially correct 26 ms 2396 KB Output is partially correct - L* = 14
4 Partially correct 26 ms 2600 KB Output is partially correct - L* = 15
5 Partially correct 25 ms 2396 KB Output is partially correct - L* = 15
6 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
7 Partially correct 25 ms 2396 KB Output is partially correct - L* = 14
8 Partially correct 26 ms 2400 KB Output is partially correct - L* = 14
9 Partially correct 25 ms 2400 KB Output is partially correct - L* = 18
10 Partially correct 26 ms 2392 KB Output is partially correct - L* = 14
11 Partially correct 26 ms 2488 KB Output is partially correct - L* = 19
12 Partially correct 26 ms 2656 KB Output is partially correct - L* = 16
13 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
14 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
15 Partially correct 25 ms 2404 KB Output is partially correct - L* = 16
16 Partially correct 26 ms 2384 KB Output is partially correct - L* = 17
17 Partially correct 27 ms 2396 KB Output is partially correct - L* = 17
18 Partially correct 25 ms 2400 KB Output is partially correct - L* = 16
19 Partially correct 26 ms 2404 KB Output is partially correct - L* = 18
20 Partially correct 30 ms 2396 KB Output is partially correct - L* = 14
21 Partially correct 26 ms 2372 KB Output is partially correct - L* = 14
22 Partially correct 26 ms 2404 KB Output is partially correct - L* = 16
23 Partially correct 30 ms 2624 KB Output is partially correct - L* = 15
24 Partially correct 28 ms 2304 KB Output is partially correct - L* = 16
25 Partially correct 27 ms 2396 KB Output is partially correct - L* = 14
26 Partially correct 26 ms 2396 KB Output is partially correct - L* = 16
27 Partially correct 26 ms 2400 KB Output is partially correct - L* = 14
28 Partially correct 25 ms 2480 KB Output is partially correct - L* = 15
29 Partially correct 26 ms 2660 KB Output is partially correct - L* = 15
30 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
31 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
32 Partially correct 27 ms 2464 KB Output is partially correct - L* = 18
33 Partially correct 26 ms 2392 KB Output is partially correct - L* = 15
34 Partially correct 26 ms 2388 KB Output is partially correct - L* = 14
35 Partially correct 26 ms 2512 KB Output is partially correct - L* = 14
36 Partially correct 26 ms 2636 KB Output is partially correct - L* = 20
37 Partially correct 26 ms 2392 KB Output is partially correct - L* = 16
38 Partially correct 28 ms 2396 KB Output is partially correct - L* = 18
39 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
40 Partially correct 26 ms 2392 KB Output is partially correct - L* = 14