제출 #819906

#제출 시각아이디문제언어결과실행 시간메모리
819906Marco_Escandon던전 (IOI21_dungeons)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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