Skip to content

Commit

Permalink
helped sarina
Browse files Browse the repository at this point in the history
  • Loading branch information
Ynng committed Feb 14, 2021
1 parent 9f7900c commit fbe58a2
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 26 deletions.
16 changes: 0 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,4 @@
"python.linting.flake8Enabled": false,
"competitive-programming-helper.firstTime": false,
"peacock.color": "#007fff",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#3399ff",
"activityBar.activeBorder": "#bf0060",
"activityBar.background": "#3399ff",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#bf0060",
"activityBarBadge.foreground": "#e7e7e7",
"statusBar.background": "#007fff",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#3399ff",
"titleBar.activeBackground": "#007fff",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#007fff99",
"titleBar.inactiveForeground": "#e7e7e799"
},
}
42 changes: 33 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
"-D_GLIBCXX_DEBUG",
"-D_GLIBCXX_DEBUG_PEDANTIC",
"-D_FORTIFY_SOURCE=2",
// "-fsanitize=undefined",
"-fno-sanitize-recover",
"-fsanitize=undefined",
"-fsanitize-undefined-trap-on-error",
"-fno-sanitize-recover"
// "-fstack-protector"
],
"group": {
Expand All @@ -35,10 +36,7 @@
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
Expand All @@ -53,11 +51,37 @@
"type": "shell",
"label": "build file - Linux",
"command": "/usr/bin/g++",
"args": ["-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}"],
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-Wall",
"-Wextra",
"-pedantic",
"-std=c++14",
"-O2",
"-Wshadow",
"-Wformat=2",
"-Wfloat-equal",
"-Wconversion",
"-Wlogical-op",
"-Wshift-overflow=2",
"-Wduplicated-cond",
"-Wcast-qual",
"-Wcast-align",
"-D_GLIBCXX_DEBUG",
"-D_GLIBCXX_DEBUG_PEDANTIC",
"-D_FORTIFY_SOURCE=2",
"-fsanitize=address",
"-fsanitize=undefined",
"-fno-sanitize-recover",
"-fstack-protector",
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": ["$gcc"],
"problemMatcher": ["$gcc"]
}
]
}
}
Binary file added CCC/20s3
Binary file not shown.
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 added Olympiad Practise/other/dpd-sarina
Binary file not shown.
24 changes: 24 additions & 0 deletions Olympiad Practise/other/dpd-sarina.cpp
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 added Other/Shredder/D1/A
Binary file not shown.
Binary file added Other/Shredder/D1/B
Binary file not shown.
Binary file added Other/Shredder/D1/C
Binary file not shown.
2 changes: 1 addition & 1 deletion Other/Shredder/D1/C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ int main()
// invocation of ::isPositive not shown
int t;
scanf("%d", &t);
printf("%d", isPositive((int*)123));
printf("%d", isPositive(&t));
}
Binary file added Other/Shredder/D1/D
Binary file not shown.
Binary file added Other/test
Binary file not shown.
45 changes: 45 additions & 0 deletions Other/test.cpp
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;
}
Binary file modified a.out
Binary file not shown.

0 comments on commit fbe58a2

Please sign in to comment.