-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"Local: test","url":"f:\\GitHub\\Practice\\CCC\\test.cpp","tests":[{"id":1614657924163,"input":"1000 10","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"f:\\GitHub\\Practice\\CCC\\test.cpp","group":"local","local":true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
typedef long long ll; | ||
typedef unsigned long long ull; | ||
typedef long double ld; | ||
typedef pair<int, int> pi; | ||
typedef pair<ll, int> pli; | ||
typedef pair<int, ll> pil; | ||
typedef pair<ll, ll> pl; | ||
typedef pair<ld, ld> pd; | ||
|
||
typedef vector<int> vi; | ||
typedef vector<ld> vd; | ||
typedef vector<ll> vl; | ||
typedef vector<pi> vpi; | ||
typedef vector<pl> vpl; | ||
|
||
#define INF 0x3f3f3f3f // for int | ||
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll | ||
#define sz(x) (int)(x).size() | ||
#define ms(x, y) memset(x, y, sizeof(x)) | ||
#define mp make_pair | ||
#define pb push_back | ||
#define f first | ||
#define s second | ||
#define lb lower_bound | ||
#define ub upper_bound | ||
#define all(x) x.begin(), x.end() | ||
#define ins insert | ||
|
||
const int MOD = 1000000007, MX = 10000 + 5; | ||
|
||
int variables; | ||
#include <iostream> | ||
using namespace std; | ||
int dp[17][500000]; | ||
int val[17]; | ||
int n; | ||
int v; | ||
int main() | ||
{ | ||
for (int i = 0; i < 500000; i++) | ||
{ | ||
cout << dp[0][i] << endl; | ||
} | ||
|
||
cin >> n >> v; | ||
dp[0][0] = 1; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
cin >> val[i]; | ||
} | ||
for (int i = 1; i <= n; i++) | ||
{ | ||
for (int j = 1; j <= v; j++) | ||
{ | ||
dp[i][j] = dp[i - 1][j] + dp[i - 1][j - val[i]]; | ||
cout << dp[i][j] << " "; | ||
} | ||
} | ||
cout << dp[n][v]; | ||
return 0; | ||
|
||
printf("Hello World"); | ||
} |