Submission #954902

# Submission time Handle Problem Language Result Execution time Memory
954902 2024-03-28T19:19:26 Z efishel Broken Device (JOI17_broken_device) C++17
8 / 100
34 ms 2796 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-1; 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-1; 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 34 ms 2744 KB Output is partially correct - L* = 15
2 Partially correct 25 ms 2500 KB Output is partially correct - L* = 16
3 Partially correct 25 ms 2396 KB Output is partially correct - L* = 14
4 Partially correct 28 ms 2372 KB Output is partially correct - L* = 15
5 Partially correct 26 ms 2536 KB Output is partially correct - L* = 15
6 Partially correct 27 ms 2404 KB Output is partially correct - L* = 15
7 Partially correct 25 ms 2360 KB Output is partially correct - L* = 14
8 Partially correct 30 ms 2796 KB Output is partially correct - L* = 14
9 Partially correct 27 ms 2512 KB Output is partially correct - L* = 18
10 Partially correct 25 ms 2404 KB Output is partially correct - L* = 14
11 Partially correct 25 ms 2396 KB Output is partially correct - L* = 19
12 Partially correct 26 ms 2496 KB Output is partially correct - L* = 17
13 Partially correct 26 ms 2480 KB Output is partially correct - L* = 15
14 Partially correct 26 ms 2472 KB Output is partially correct - L* = 15
15 Partially correct 26 ms 2368 KB Output is partially correct - L* = 16
16 Partially correct 28 ms 2304 KB Output is partially correct - L* = 17
17 Partially correct 25 ms 2404 KB Output is partially correct - L* = 17
18 Partially correct 26 ms 2452 KB Output is partially correct - L* = 16
19 Partially correct 26 ms 2400 KB Output is partially correct - L* = 18
20 Partially correct 25 ms 2404 KB Output is partially correct - L* = 14
21 Partially correct 31 ms 2488 KB Output is partially correct - L* = 15
22 Partially correct 26 ms 2460 KB Output is partially correct - L* = 16
23 Partially correct 26 ms 2484 KB Output is partially correct - L* = 15
24 Partially correct 26 ms 2404 KB Output is partially correct - L* = 16
25 Partially correct 25 ms 2396 KB Output is partially correct - L* = 14
26 Partially correct 30 ms 2436 KB Output is partially correct - L* = 16
27 Partially correct 27 ms 2396 KB Output is partially correct - L* = 14
28 Partially correct 27 ms 2396 KB Output is partially correct - L* = 15
29 Partially correct 25 ms 2392 KB Output is partially correct - L* = 15
30 Partially correct 27 ms 2388 KB Output is partially correct - L* = 15
31 Partially correct 25 ms 2396 KB Output is partially correct - L* = 15
32 Partially correct 26 ms 2404 KB Output is partially correct - L* = 18
33 Partially correct 26 ms 2396 KB Output is partially correct - L* = 15
34 Partially correct 26 ms 2396 KB Output is partially correct - L* = 14
35 Partially correct 28 ms 2400 KB Output is partially correct - L* = 14
36 Partially correct 25 ms 2404 KB Output is partially correct - L* = 20
37 Partially correct 26 ms 2400 KB Output is partially correct - L* = 16
38 Partially correct 26 ms 2368 KB Output is partially correct - L* = 18
39 Partially correct 32 ms 2740 KB Output is partially correct - L* = 15
40 Partially correct 26 ms 2368 KB Output is partially correct - L* = 14