Submission #72671

# Submission time Handle Problem Language Result Execution time Memory
72671 2018-08-26T14:02:19 Z ikura355 Broken Device (JOI17_broken_device) C++14
0 / 100
63 ms 5272 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;

#define ll long long
const int maxn = 150 + 5;

int bad[maxn], res[maxn];
int bit[65];

void Anna(int N, long long X, int K, int P[]) {
    for(int i=0;i<N;i++) bad[i] = 0;
    for(int i=0;i<K;i++) bad[P[i]] = 1;
    for(int i=0;i<60;i++) bit[i] = (X&(1LL<<i)) ? 1 : 0;
    for(int i=0;i<N;i++) res[i] = 0;
    for(int x=1;x+60<N;x++) {
        if(bad[x-1]) continue;
        for(int y=x;y+60<N;y++) {
            if(bad[y+60]) continue;
            int good = 1;
            for(int i=0;i<60;i++) {
                if(bit[i] && bad[x+i] && bad[y+i]) good = 0;
            }
            if(good) {
//                printf("Anna : x = %d y = %d\n",x,y);
                for(int i=0;i<60;i++) {
                    res[x+i] = res[y+i] = bit[i];
                }
                res[x-1] = res[y+60] = 1;
                for(int i=0;i<N;i++) Set(i,res[i]);
                return ;
            }
        }
    }
    assert(0);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;

#define ll long long

ll Bruno(int N, int A[]) {
    int x,y;
    for(int i=0;i<N;i++) {
        if(A[i]==1) {
            x = i+1;
            break;
        }
    }
    for(int i=0;i<N;i++) {
        if(A[i]==1) {
            y = i-60;
        }
    }
    ll ans = 0;
//    printf("Bruno : x = %d y = %d\n",x,y);
    for(int i=0;i<60;i++) {
        ans += (1LL<<i) * (A[x+i]|A[y+i]);
    }
//    printf("ans = %lld\n",ans);
    return ans;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:8:9: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int x,y;
         ^
Bruno.cpp:8:11: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int x,y;
           ^
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Incorrect 53 ms 3904 KB Output isn't correct - L* = 0
3 Runtime error 10 ms 1952 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Incorrect 63 ms 4560 KB Output isn't correct - L* = 0
5 Runtime error 10 ms 2280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Incorrect 57 ms 4560 KB Output isn't correct - L* = 0
7 Runtime error 10 ms 2280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 7 ms 2280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 10 ms 2280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 15 ms 2280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Incorrect 56 ms 5008 KB Output isn't correct - L* = 0
12 Runtime error 4 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 10 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Incorrect 54 ms 5008 KB Output isn't correct - L* = 0
15 Incorrect 53 ms 5008 KB Output isn't correct - L* = 0
16 Incorrect 56 ms 5008 KB Output isn't correct - L* = 0
17 Incorrect 61 ms 5008 KB Output isn't correct - L* = 0
18 Runtime error 5 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 5 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Incorrect 46 ms 5008 KB Output isn't correct - L* = 0
21 Runtime error 10 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 12 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 7 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 6 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 10 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Incorrect 53 ms 5008 KB Output isn't correct - L* = 0
27 Runtime error 13 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 18 ms 2504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Incorrect 52 ms 5272 KB Output isn't correct - L* = 0
30 Runtime error 10 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 10 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 4 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 6 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 9 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 13 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 8 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 11 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 7 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Incorrect 47 ms 5272 KB Output isn't correct - L* = 0
40 Runtime error 11 ms 2636 KB Execution killed with signal 11 (could be triggered by violating memory limits)