-
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
14 changed files
with
104 additions
and
26 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
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
1 change: 1 addition & 0 deletions
1
Olympiad Practise/other/.cph/.dpd-sarina.cpp_123318815941d551c9cd6acb5227aafd.prob
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: dpd-sarina","url":"/mnt/f/GitHub/Practice/Olympiad Practise/other/dpd-sarina.cpp","tests":[{"id":1613338963131,"input":"","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/mnt/f/GitHub/Practice/Olympiad Practise/other/dpd-sarina.cpp","group":"local","local":true} |
Binary file not shown.
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,24 @@ | ||
#include <iostream> | ||
// #include <bits/stdc++.h> | ||
using namespace std; | ||
int n, w; | ||
long long int wt[105]; | ||
long long int prof[105]; | ||
int main() { | ||
// ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); | ||
cin >> n >> w; | ||
long long int s[n+1][w+1]; | ||
for (int i = 0; i < n; ++i) { | ||
cin >> wt[i] >> prof[i]; | ||
} | ||
for (int i = 1; i <= n; ++i) { | ||
for (int j = 1;j <=w; ++j) { | ||
if (wt[i-1] <=j) { | ||
s[i][j] = max(prof[i-1]+s[i-1][j-wt[i-1]], s[i-1][j]); | ||
} else{ | ||
s[i][j] = s[i-1][j]; | ||
} | ||
} | ||
} | ||
cout << s[n][w] << endl; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
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,45 @@ | ||
#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 main() | ||
{ | ||
int i = 0; | ||
i=23; | ||
i<<=32; | ||
i+=1147483648; | ||
i+=1147483648; | ||
i+=1147483648; | ||
|
||
printf("%d", i); | ||
|
||
return 0; | ||
} |