/in/foo.cc: In function 'int main()':
/in/foo.cc:19:48: warning: array subscript is above array bounds [-Warray-bounds]
for(int i=1;i<=n;i++) dp[i][1][1]=1,dp[i][1][2]=num[i];
~~~~~~~~~~^
/in/foo.cc:32:83: warning: array subscript is above array bounds [-Warray-bounds]
if(dp[i-1][j-1][1]<m&&dp[i-1][j-1][1]) dp[i][j][1]=dp[i-1][j-1][1]+1,dp[i][j][2]=num[i];
~~~~~~~~~~^
/in/foo.cc:33:38: warning: array subscript is above array bounds [-Warray-bounds]
if(dp[i-1][j-1][1]&&dp[i-1][j-1][2]+num[i]<=t)
~~~~~~~~~~~~~~^
/in/foo.cc:34:60: warning: array subscript is above array bounds [-Warray-bounds]
dp[i][j][1]=dp[i-1][j-1][1],dp[i][j][2]=dp[i-1][j-1][2]+num[i];
~~~~~~~~~~~~~~^
/in/foo.cc:34:44: warning: array subscript is above array bounds [-Warray-bounds]
dp[i][j][1]=dp[i-1][j-1][1],dp[i][j][2]=dp[i-1][j-1][2]+num[i];
~~~~~~~~~~^
/in/foo.cc:35:94: warning: array subscript is above array bounds [-Warray-bounds]
if(dp[i-1][j][1]&&(dp[i-1][j][1]<dp[i][j][1]||(dp[i-1][j][1]==dp[i][j][1]&&dp[i-1][j][2]<dp[i][j][2])))
~~~~~~~~~~~~^
/in/foo.cc:35:106: warning: array subscript is above array bounds [-Warray-bounds]
if(dp[i-1][j][1]&&(dp[i-1][j][1]<dp[i][j][1]||(dp[i-1][j][1]==dp[i][j][1]&&dp[i-1][j][2]<dp[i][j][2])))
~~~~~~~~~~^
/in/foo.cc:36:59: warning: array subscript is above array bounds [-Warray-bounds]
dp[i][j][1]=dp[i-1][j][1],dp[i][j][2]=dp[i-1][j][2];
~~~~~~~~~~~~^
/in/foo.cc:36:45: warning: array subscript is above array bounds [-Warray-bounds]
dp[i][j][1]=dp[i-1][j][1],dp[i][j][2]=dp[i-1][j][2];
~~~~~~~~~~^