feat(runner): compile Go and check answers per test group
This commit is contained in:
1 parent
e95c681165
commit
afee564bf4
61 files changed
+2592
-143
No files matched your search
@@ -0,0 +1,4 @@
|
||||
import sys
|
||||
|
||||
values = [int(token) for token in sys.stdin.read().split()]
|
||||
print(sum(values) / len(values))
|
||||
@@ -0,0 +1,5 @@
|
||||
# Wrong: rounds to two decimals, so only exact means pass the tolerance.
|
||||
import sys
|
||||
|
||||
values = [int(token) for token in sys.stdin.read().split()]
|
||||
print(f"{sum(values) / len(values):.2f}")
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# Prints any pair of 1-based positions whose values add up to the target.
|
||||
import sys
|
||||
|
||||
lines = sys.stdin.read().split("\n")
|
||||
target = int(lines[0])
|
||||
values = [int(token) for token in lines[1].split()]
|
||||
seen = {}
|
||||
for position, value in enumerate(values, start=1):
|
||||
if target - value in seen:
|
||||
print(seen[target - value], position)
|
||||
break
|
||||
seen.setdefault(value, position)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import sys
|
||||
|
||||
print(sum(int(token) for token in sys.stdin.read().split()))
|
||||
@@ -0,0 +1,4 @@
|
||||
# Wrong: adds absolute values, so only groups with negative numbers fail.
|
||||
import sys
|
||||
|
||||
print(sum(abs(int(token)) for token in sys.stdin.read().split()))
|
||||
Reference in new issue
Block a user