diff --git a/.vscode/settings.json b/.vscode/settings.json index e69d5b6..84d18cf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" - }, } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3ac16b8..04bba64 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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": { @@ -35,10 +36,7 @@ }, "problemMatcher": { "owner": "cpp", - "fileLocation": [ - "relative", - "${workspaceFolder}" - ], + "fileLocation": ["relative", "${workspaceFolder}"], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, @@ -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"] } ] -} \ No newline at end of file +} diff --git a/CCC/20s3 b/CCC/20s3 new file mode 100644 index 0000000..41fd1a4 Binary files /dev/null and b/CCC/20s3 differ diff --git a/Olympiad Practise/other/.cph/.dpd-sarina.cpp_123318815941d551c9cd6acb5227aafd.prob b/Olympiad Practise/other/.cph/.dpd-sarina.cpp_123318815941d551c9cd6acb5227aafd.prob new file mode 100644 index 0000000..2f4cd4f --- /dev/null +++ b/Olympiad Practise/other/.cph/.dpd-sarina.cpp_123318815941d551c9cd6acb5227aafd.prob @@ -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} \ No newline at end of file diff --git a/Olympiad Practise/other/dpd-sarina b/Olympiad Practise/other/dpd-sarina new file mode 100644 index 0000000..0456057 Binary files /dev/null and b/Olympiad Practise/other/dpd-sarina differ diff --git a/Olympiad Practise/other/dpd-sarina.cpp b/Olympiad Practise/other/dpd-sarina.cpp new file mode 100644 index 0000000..1ac2fbf --- /dev/null +++ b/Olympiad Practise/other/dpd-sarina.cpp @@ -0,0 +1,24 @@ +#include +// #include +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; +} \ No newline at end of file diff --git a/Other/Shredder/D1/A b/Other/Shredder/D1/A new file mode 100644 index 0000000..5b678a4 Binary files /dev/null and b/Other/Shredder/D1/A differ diff --git a/Other/Shredder/D1/B b/Other/Shredder/D1/B new file mode 100644 index 0000000..85da2e0 Binary files /dev/null and b/Other/Shredder/D1/B differ diff --git a/Other/Shredder/D1/C b/Other/Shredder/D1/C new file mode 100644 index 0000000..483b6f0 Binary files /dev/null and b/Other/Shredder/D1/C differ diff --git a/Other/Shredder/D1/C.cpp b/Other/Shredder/D1/C.cpp index e8f1b05..80fe5fe 100644 --- a/Other/Shredder/D1/C.cpp +++ b/Other/Shredder/D1/C.cpp @@ -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)); } diff --git a/Other/Shredder/D1/D b/Other/Shredder/D1/D new file mode 100644 index 0000000..0133896 Binary files /dev/null and b/Other/Shredder/D1/D differ diff --git a/Other/test b/Other/test new file mode 100644 index 0000000..68c19ec Binary files /dev/null and b/Other/test differ diff --git a/Other/test.cpp b/Other/test.cpp new file mode 100644 index 0000000..2f55157 --- /dev/null +++ b/Other/test.cpp @@ -0,0 +1,45 @@ +#include +using namespace std; +typedef long long ll; +typedef unsigned long long ull; +typedef long double ld; +typedef pair pi; +typedef pair pli; +typedef pair pil; +typedef pair pl; +typedef pair pd; + +typedef vector vi; +typedef vector vd; +typedef vector vl; +typedef vector vpi; +typedef vector 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; +} \ No newline at end of file diff --git a/a.out b/a.out index da7af90..5981274 100644 Binary files a/a.out and b/a.out differ