Submission #210815

# Submission time Handle Problem Language Result Execution time Memory
210815 2020-03-18T11:19:30 Z SorahISA Job Scheduling (IOI19_job) C++17
Compilation error
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(auto f=[&](){int i=0,t=0,ans=0;for(;++i<p.size();)ans+=(t+=d[i])*u[i];return ans;},f());
}

Compilation message

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