답안 #210810

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
210810 2020-03-18T11:18:34 Z SorahISA Job Scheduling (IOI19_job) C++17
컴파일 오류
0 ms 0 KB
#include "job.h"
#include <bits/stdc++.h>
using namespace std;

#define int long long

int scheduling_cost(vector<int32_t> p, vector<int32_t> u, vector<int32_t> d) {
    return[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;};
}

Compilation message

job.cpp: In lambda function:
job.cpp:8:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     return[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;};
                                        ~~~^~~~~~~~~
job.cpp: In function 'long long int scheduling_cost(std::vector<int>, std::vector<int>, std::vector<int>)':
job.cpp:8:85: error: cannot convert 'scheduling_cost(std::vector<int>, std::vector<int>, std::vector<int>)::<lambda()>' to 'long long int' in return
     return[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;};
                                                                                     ^