job.cpp: In lambda function:
job.cpp:8:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return[&](){for(int i=0,t=0,ans=0;i<p.size();++i)ans+=(t+=d[i])*u[i];return ans;};
~^~~~~~~~~
job.cpp:8:81: error: 'ans' was not declared in this scope
return[&](){for(int i=0,t=0,ans=0;i<p.size();++i)ans+=(t+=d[i])*u[i];return ans;};
^~~
job.cpp:8:81: note: suggested alternative: 'abs'
return[&](){for(int i=0,t=0,ans=0;i<p.size();++i)ans+=(t+=d[i])*u[i];return ans;};
^~~
abs
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[&](){for(int i=0,t=0,ans=0;i<p.size();++i)ans+=(t+=d[i])*u[i];return ans;};
^