Submission #134809

#TimeUsernameProblemLanguageResultExecution timeMemory
134809MAMBARoller Coaster Railroad (IOI16_railroad)C++17
Compilation error
0 ms0 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; #define rep(i , j , k) for (int i = j; i < (int)k; i++) typedef long long ll; ll dp[1 << 17][17]; void smin(ll &a, ll b) { if (b < a) a = b; } long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); rep(mask , 1 , (1 << n)) { rep(r , 0, n ) { dp[mask][r] = 1e18; if (__builtin_popcount(mask) == 1) { if ((mask >> r) & 1) dp[mask][r] = 0; continue; } if (!((mask >> r) & 1)) continue; rep(i , 0 , n) { if (i != r && (mask >> i) & 1) smin(dp[mask][r] , dp[mask ^ (1 << r)][i] + max(0 , t[i] - s[r])); } } } ll res = 1e18; rep(i , 0 , n) { // cout << dp[(1 << n) - 1][i] << endl; smin(res , dp[(1 << n) - 1][i]); }

Compilation message (stderr)

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:39:2: error: expected '}' at end of input
  }
  ^
railroad.cpp:39:2: warning: no return statement in function returning non-void [-Wreturn-type]