Submission #959112

# Submission time Handle Problem Language Result Execution time Memory
959112 2024-04-07T13:46:11 Z Abito Broken Device (JOI17_broken_device) C++17
Compilation error
0 ms 0 KB
#include "Annalib.h"
bool vis[155];
void Anna( int n, long long X, int k, int p[] ){
    memset(vis,0,sizeof(vis));
    long long j=0;
    for (int i=0;i<k;i++) vis[p[k]]=1;
    for (int i=0;i<n;i+=2){
        if (vis[i] || vis[i+1] || j>=60LL){
            Set(i,0);
            Set(i+1,0);
            continue;
        }
        if (X&(1LL<<j)){
            Set(i,0);
            Set(i+1,1);
        }
        else{
            Set(i,1);
            Set(i+1,0);
        }
    }return;
}
#include "Brunolib.h"

long long Bruno( int n, int a[] ){
    long long X=0,j=0;
    for (int i=0;i<n;i+=2){
        if (!a[i] && !a[i+1]) continue;
        if (a[i+1]) X|=(1LL<<j);
        j++;
    }return X;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:4:5: error: 'memset' was not declared in this scope
    4 |     memset(vis,0,sizeof(vis));
      |     ^~~~~~
Anna.cpp:2:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
    1 | #include "Annalib.h"
  +++ |+#include <cstring>
    2 | bool vis[155];