제출 #601725

#제출 시각아이디문제언어결과실행 시간메모리
601725enerelt14모임들 (IOI18_meetings)C++14
컴파일 에러
0 ms0 KiB
#include "meetings.h" #include<bits/stdc++.h> #define pb push_back #define int long long using namespace std; int cost[5005][5005]; vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){ for (int i=0;i<H.size();i++){ cost[i][i]=H[i]; for(int j=i+1;j<H.size();j++){ cost[i][j]=max(cost[i][j-1], H[j]); } } for (int i=0;i<H.size();i++){ for (int j=0;j<i;j++){ cost[i][j]=cost[j][i]; } } for (int i=0;i<H.size();i++){ for (int j=0;j<H.size();j++){ cost[i][j]+=cost[i][j-1]; } } vector<long long>res; for (int i=0;i<L.size();i++){ long long ans=1e15; for (int j=L[i];j<=R[i];j++){ if (L[i]!=0)ans=min(ans, cost[j][R[i]]-cost[j][L[i]-1]); else ans=min(ans, cost[j][R[i]]); } res.pb(ans); } return res; }

컴파일 시 표준 에러 (stderr) 메시지

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
meetings.cpp:8:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   for (int i=0;i<H.size();i++){
      |                ~^~~~~~~~~
meetings.cpp:10:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int j=i+1;j<H.size();j++){
      |                   ~^~~~~~~~~
meetings.cpp:14:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   for (int i=0;i<H.size();i++){
      |                ~^~~~~~~~~
meetings.cpp:19:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   for (int i=0;i<H.size();i++){
      |                ~^~~~~~~~~
meetings.cpp:20:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for (int j=0;j<H.size();j++){
      |                  ~^~~~~~~~~
meetings.cpp:25:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   for (int i=0;i<L.size();i++){
      |                ~^~~~~~~~~
/usr/bin/ld: /tmp/cchiolrc.o: in function `main':
grader.cpp:(.text.startup+0x1d6): undefined reference to `minimum_costs(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status