Submission #210815

#TimeUsernameProblemLanguageResultExecution timeMemory
210815SorahISAJob Scheduling (IOI19_job)C++17
Compilation error
0 ms0 KiB
#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(auto f=[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;},f()); }

Compilation message (stderr)

job.cpp: In function 'long long int scheduling_cost(std::vector<int>, std::vector<int>, std::vector<int>)':
job.cpp:8:12: error: expected primary-expression before 'auto'
     return(auto f=[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;},f());
            ^~~~
job.cpp:8:12: error: expected ')' before 'auto'
job.cpp:8:95: error: 'f' was not declared in this scope
     return(auto f=[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;},f());
                                                                                               ^
job.cpp:8:98: error: expected ';' before ')' token
     return(auto f=[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;},f());
                                                                                                  ^
job.cpp:8:98: error: expected primary-expression before ')' token