Submission #819906

#TimeUsernameProblemLanguageResultExecution timeMemory
819906Marco_EscandonDungeons Game (IOI21_dungeons)C++17
Compilation error
0 ms0 KiB

#include<bits/stdc++.h>
typedef long long  ll;
using namespace std;
std::vector<int> distribute_candies(std::vector<int> cad, std::vector<int> l, std::vector<int> r, std::vector<int> v)
{
    ll t[cad.size()+5]={};
    ll n=cad.size();
    for(int i=0; i<l.size(); i++)
    {
        t[l[i]]+=v[i];
        t[r[i]+1]-=v[i];
    }
    cad[0]=min(t[0],(ll)cad[0]);
    for(int i=1; i<n; i++)
    {
        t[i]+=t[i-1];
        cad[i]=min(t[i],(ll)cad[i]);
    }
    return cad;
}

Compilation message (stderr)

dungeons.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int i=0; i<l.size(); i++)
      |                  ~^~~~~~~~~
/usr/bin/ld: /tmp/cc1qHGBV.o: in function `main':
grader.cpp:(.text.startup+0x3bd): undefined reference to `init(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x440): undefined reference to `simulate(int, int)'
collect2: error: ld returned 1 exit status