Submission #100097

# Submission time Handle Problem Language Result Execution time Memory
100097 2019-03-09T08:27:01 Z rocketninja7 Broken Device (JOI17_broken_device) C++14
Compilation error
0 ms 0 KB
#include "Brunolib.h"
#include <vector>
using namespace std;

long long Bruno( int N, int A[] ){
    vector<int> available;
    for(int i=0;i<N;i++){
        if(A[i]==1){
            available.push_back(i);
            i+=2;
        }
    }
    long long ans=0;
    for(int i=0;i<available.size();i++){
        if(A[available[i]+1]){
            ans+=(1LL<<(2*i));
        }
        if(A[available[i]+2]){
            ans+=(1LL<<(2*i+1));
        }
    }
    return ans;
}
#include "Brunolib.h"
#include <vector>
using namespace std;

long long Bruno( int N, int A[] ){
    vector<int> available;
    for(int i=0;i<N;i++){
        if(A[i]==1){
            available.push_back(i);
            i+=2;
        }
    }
    long long ans=0;
    for(int i=0;i<available.size();i++){
        if(A[available[i]+1]){
            ans+=(1LL<<(2*i));
        }
        if(A[available[i]+2]){
            ans+=(1LL<<(2*i+1));
        }
    }
    return ans;
}

Compilation message

Anna.cpp: In function 'long long int Bruno(int, int*)':
Anna.cpp:14:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<available.size();i++){
                 ~^~~~~~~~~~~~~~~~~
/tmp/ccnW4jtn.o: In function `main':
grader_anna.c:(.text.startup+0xdc): undefined reference to `Anna(int, long long, int, int*)'
collect2: error: ld returned 1 exit status

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:14:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<available.size();i++){
                 ~^~~~~~~~~~~~~~~~~