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_39683008_1482.cpp:2:14: error: invalid types 'int[int]' for array subscript
    2 | int dp[100010[100010]={0};
      |              ^
0_0_39683008_1482.cpp:2:26: error: expected ']' before ';' token
    2 | int dp[100010[100010]={0};
      |                          ^
      |                          ]
0_0_39683008_1482.cpp: In function 'int main()':
0_0_39683008_1482.cpp:25:44: error: 'dp' was not declared in this scope
   25 |                                         if(dp[i][k-c[i][j]]!=-1)
      |                                            ^~
0_0_39683008_1482.cpp:27:58: error: 'max' was not declared in this scope
   27 |                                                 dp[i][k]=max(dp[i][k],dp[i][k-c[i][j]]+w[i][j]);   //避免0花费买重复,当前先买0
      |                                                          ^~~
0_0_39683008_1482.cpp:27:58: note: suggested alternatives:
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:61,
                 from .\stdc++.h:51:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:5805:5: note:   'std::max'
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:63:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_algo.h:2928:29: note:   'std::ranges::max'
 2928 |   inline constexpr __max_fn max{};
      |                             ^~~
0_0_39683008_1482.cpp:29:44: error: 'dp' was not declared in this scope
   29 |                                         if(dp[i-1][k-c[i][j]]!=-1)
      |                                            ^~
0_0_39683008_1482.cpp:31:58: error: 'max' was not declared in this scope
   31 |                                                 dp[i][k]=max(dp[i][k],dp[i-1][k-c[i][j]]+w[i][j]);//上一层再买0也无法更新dp
      |                                                          ^~~
0_0_39683008_1482.cpp:31:58: note: suggested alternatives:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:5805:5: note:   'std::max'
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_algo.h:2928:29: note:   'std::ranges::max'
 2928 |   inline constexpr __max_fn max{};
      |                             ^~~
0_0_39683008_1482.cpp:36:20: error: 'dp' was not declared in this scope
   36 |                 if(dp[b][m]!=-1)
      |                    ^~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-01-08 14:12:25, Gzip enabled