Submission #1008622

#TimeUsernameProblemLanguageResultExecution timeMemory
1008622aaaaaarrozOvertaking (IOI23_overtaking)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int l,n,x,m; vector<ll>t; vector<int>w,s; void init(int L,int N,vector<ll>T,vector<int>W,int X,int M,vector<int>S){ l=L; n=N; t=T; w=W; x=X; m=M; s=S; } ll arrival_time(ll arrival){ vector<ll>ex(n+1); vector<pair<ll,ll>>time(n+1); for(int i=0;i<n;i++){ time[i]={t[i],i}; time[n]={arrival,n}; } for(int i=1;i<m;i++){ for(int j=0;j<n;j++){ ex[j]=time[j].first+(w[j]*(s[i]-s[i-1])); } ex[n]=(time[n].first+(x*(s[i]-s[i-1]))); map<ll,vector<ll>>nv; for(int j=0;j<=n;j++){ nv[time[j].first].push_back(j); } ll mx=0; auto newtime=time; for(auto [key, val]:nv){ for(auto v:val){ newtime[v]={v,max(mx,ex[v])}; } for(auto v:val){ mx=max(mx,ex[v]); } } sort(all(newtime)); for(int j=0;j<=n;j++){ time[j]={newtime[j].second,newtime[j].first}; } } return time[n].first; }

Compilation message (stderr)

overtaking.cpp: In function 'll arrival_time(ll)':
overtaking.cpp:42:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   42 |   sort(all(newtime));
      |        ^~~
      |        std::filesystem::perms::all
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from overtaking.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:148:7: note: 'std::filesystem::perms::all' declared here
  148 |       all  =  0777,
      |       ^~~