forked from RagnarGrootKoerkamp/BAPCtools
-
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.
[test] Convert submission and validators from C++ to Python, to avoid…
… compile time for every test
- Loading branch information
Showing
9 changed files
with
37 additions
and
32 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 was deleted.
Oops, something went wrong.
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,11 @@ | ||
#!/usr/bin/env python3 | ||
|
||
try: | ||
if 0 <= int(input()) < 1_000_000: | ||
exit(42) | ||
else: | ||
print("Out of range") | ||
exit(43) | ||
except Exception as e: | ||
print(e) | ||
exit(43) |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
#!/usr/bin/env python3 | ||
import math | ||
import sys | ||
|
||
try: | ||
# Do not use the default_output_validator.cpp, because it's wasteful to compile it for every test | ||
if math.isclose( | ||
4 * float(open(sys.argv[1]).read()) ** 0.5, | ||
float(open(sys.argv[2]).read()), | ||
rel_tol=1e-6, | ||
abs_tol=1e-6, | ||
): | ||
exit(42) | ||
else: | ||
print("WA") | ||
exit(43) | ||
except Exception as e: | ||
print(e) | ||
exit(43) |
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 was deleted.
Oops, something went wrong.
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,2 @@ | ||
#!/usr/bin/env python3 | ||
print(4 * int(input()) ** 0.5) |
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