-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change stack size to unlimited before running (#103)
* Add function for unlimiting stack size * Catch errors when changing stack size * Change severity of the error * Set stack size to max memory limit * Add tests * Fix tests for Linux * Set hard limit when it's lower than wanted soft limit * Fix tests * Refactor finding max memory * Change package for testing stack size * Change stack size to unlimited * Kill solution if it is running with memory limit exceeded * Add tests * Add comment to `change_stack_size_to_unlimited` * Change `stc` package * Change memory limit in `stc` package
- Loading branch information
1 parent
e5705ef
commit 2ea7989
Showing
14 changed files
with
126 additions
and
11 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 |
---|---|---|
|
@@ -28,6 +28,7 @@ install_requires = | |
PyYAML | ||
dictdiffer | ||
importlib-resources | ||
psutil | ||
|
||
[options.packages.find] | ||
where = src | ||
|
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
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
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
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,9 @@ | ||
title: Package for testing if changing stack size works | ||
|
||
memory_limit: 1000 | ||
time_limit: 10000 | ||
|
||
sinol_expected_scores: | ||
stc.cpp: | ||
expected: {1: OK} | ||
points: 100 |
Empty file.
Empty file.
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,19 @@ | ||
#include <bits/stdc++.h> | ||
#include <chrono> | ||
|
||
using namespace std; | ||
using namespace std::chrono_literals; | ||
|
||
|
||
int main() { | ||
char array[30000000]; // 30 MB | ||
for (int i = 0; i < 30000000; i++) { | ||
array[i] = 'a'; | ||
} | ||
this_thread::sleep_for(5s); | ||
int a, b; | ||
cin >> a >> b; | ||
array[a] = (char)b; | ||
cout << a + array[a]; | ||
return 0; | ||
} |
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,9 @@ | ||
#include <bits/stdc++.h> | ||
|
||
using namespace std; | ||
|
||
int main() { | ||
ofstream f("stc1a.in"); | ||
f << "1 2\n"; | ||
f.close(); | ||
} |
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