F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_29471330_12285.cpp:1:11: error: #include expects "FILENAME" or <FILENAME>
 #include  #include  #include   using namespace std;  const int N = 25; const int INF = 0x3f3f3f3f; int n, f[N], s[N], dp[N][N][N][N][2];  void init () { memset(dp, -1, sizeof(dp));  scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &f[i]); for (int i = 1; i <= n; i++) scanf("%d", &s[i]); }  int solve (int fl, int fr, int sl, int sr, int flag) { int& ans = dp[fl][fr][sl][sr][flag]; if (fl > fr && sl > sr) return ans = 0;  if (ans != -1) return ans;  if (flag) { ans = 0; if (fl <= fr) { ans = max(ans, solve(fl+1, fr, sl, sr, 1-flag) + f[fl]); ans = max(ans, solve(fl, fr-1, sl, sr, 1-flag) + f[fr]); }  if (sl <= sr) { ans = max(ans, solve(fl, fr, sl+1, sr, 1-flag) + s[sl]); ans = max(ans, solve(fl, fr, sl, sr-1, 1-flag) + s[sr]); } } else { ans = INF; if (fl <= fr) { ans = min(ans, solve(fl+1, fr, sl, sr, 1-flag)); ans = min(ans, solve(fl, fr-1, sl, sr, 1-flag)); }  if (sl <= sr) { ans = min(ans, solve(fl, fr, sl+1, sr, 1-flag)); ans = min(ans, solve(fl, fr, sl, sr-1, 1-flag)); } } return ans; }  int main () { int cas; scanf("%d", &cas); while (cas--) { init (); printf("%d\n", solve(1, n, 1, n, 1)); } return 0; }
           ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 10:12:24, Gzip enabled