Submission #121118

#TimeUsernameProblemLanguageResultExecution timeMemory
121118WhipppedCreamRoller Coaster Railroad (IOI16_railroad)C++17
Compilation error
0 ms0 KiB
#include "railroad.h" #include <bits/stdc++.h> #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; #define X first #define Y second #define pb push_back typedef pair<int, int> ii; typedef long long ll; const int maxn = 18; int dp[maxn][1<<maxn]; int n; int s[maxn], t[maxn]; ll solve(int u, int bit) { if(bit == (1<<n)-1) return 0; if(dp[u][bit] != -1) return dp[u][bit]; ll best = 1e18; for(int i = 0; i< n; i++) { if(bit&(1<<i)) continue; best = min(best, (T[u]<= S[i]?0:T[u]-S[i])solve(i, bit|(1<<i))); } return best; } ll plan_roller_coaster(vector<int> S, vector<int> T) { n = S.size(); for(int i = 0; i< n; i++) { s[i] = S[i]; t[i] = T[i]; } ll best = 1e18; for(int i = 0; i< n; i++) best = min(best, solve(i, 1<<i)); return best; }

Compilation message (stderr)

railroad.cpp: In function 'll solve(int, int)':
railroad.cpp:28:21: error: 'T' was not declared in this scope
   best = min(best, (T[u]<= S[i]?0:T[u]-S[i])solve(i, bit|(1<<i)));
                     ^
railroad.cpp:28:28: error: 'S' was not declared in this scope
   best = min(best, (T[u]<= S[i]?0:T[u]-S[i])solve(i, bit|(1<<i)));
                            ^