Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.217.105
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
scripts /
Delete
Unzip
Name
Size
Permission
Date
Action
A-cpp
174
B
-rwxr-xr--
2024-08-28 22:43
A-python-2.py
45
B
-rw-r--r--
2024-08-28 22:43
A-python.py
129
B
-rwxr-xr--
2024-08-28 22:43
B-cpp
210
B
-rw-r--r--
2024-08-28 22:43
B-python.py
118
B
-rw-r--r--
2024-08-28 22:43
C-cpp
242
B
-rw-r--r--
2024-08-28 22:43
D-cpp
242
B
-rw-r--r--
2024-08-28 22:43
D-python.py
160
B
-rw-r--r--
2024-08-28 22:43
E-cpp1
595
B
-rw-r--r--
2024-08-28 22:43
E-cpp2
164
B
-rw-r--r--
2024-08-28 22:43
E-python.py
337
B
-rw-r--r--
2024-08-28 22:43
F-cpp
563
B
-rwxr-xr--
2024-08-28 22:43
G-cpp
480
B
-rwxr-xr--
2024-08-28 22:43
H-cpp
1018
B
-rw-r--r--
2024-08-28 22:43
I-cpp
1.59
KB
-rw-r--r--
2024-08-28 22:43
J-cpp
1.16
KB
-rw-r--r--
2024-08-28 22:43
K-cpp
2.04
KB
-rwxr-xr--
2024-08-28 22:43
Save
Rename
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> X(N),Y(N); for(int i = 0;i < N;i++) cin >> X[i]; for(int i = 0;i < N;i++) cin >> Y[i]; vector<vector<int>> dp(N+1,vector<int>(M,0)); for(int i = 1;i <= N;i++){ for(int j = 0;j < M;j++){ if(j>=Y[i-1]) dp[i][j]=max(dp[i-1][j],dp[i-1][j-Y[i-1]]+X[i-1]); else dp[i][j]=dp[i-1][j]; } } cout << dp[N][M-1] << endl; }