Submission #410833

#TimeUsernameProblemLanguageResultExecution timeMemory
410833EJOI2019AndrewRoller Coaster Railroad (IOI16_railroad)C++14
Compilation error
0 ms0 KiB
#include "railroad.h" #include<bits/stdc++.h> #define ll long long int #define vi vector<int> using namespace std; long long plan_roller_coaster(vector<int> s,vector<int> t) { int n=(int)s.size(); ll res=1e18; vi a; for(int i=0;i<n;i++) a.pb(i); do{ ll G=0,c=0; for(int i=0;i<n;i++) { if(c>s[a[i]]) G+=(c-s[a[i]]); } c=t[a[i]]; res=min(res,G); }while(next_permutation(a.begin(),a.end())); return res; }

Compilation message (stderr)

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:11:11: error: 'class std::vector<int>' has no member named 'pb'
   11 |         a.pb(i);
      |           ^~
railroad.cpp:19:19: error: 'i' was not declared in this scope
   19 |             c=t[a[i]];
      |                   ^