remove compile flags, debug scripts
This commit is contained in:
parent
fafe841057
commit
737e8e0255
180 changed files with 0 additions and 5153 deletions
|
|
@ -1,5 +0,0 @@
|
||||||
-std=c++23
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wpedantic
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
-std=c++20
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wpedantic
|
|
||||||
-Wconversion
|
|
||||||
-Wsign-conversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wsign-conversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
-std=c++20
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
-std=c++20
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-pedantic-errors
|
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wpedantic
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-pedantic-errors
|
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-godbolt-compiler=g143
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-godbolt-compiler=g143
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wpedantic
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wpedantic
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++20
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
-O2
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Wshadow
|
|
||||||
-Wformat=2
|
|
||||||
-Wfloat-equal
|
|
||||||
-Wlogical-op
|
|
||||||
-Wshift-overflow=2
|
|
||||||
-Wnon-virtual-dtor
|
|
||||||
-Wold-style-cast
|
|
||||||
-Wcast-qual
|
|
||||||
-Wuseless-cast
|
|
||||||
-Wno-sign-promotion
|
|
||||||
-Wcast-align
|
|
||||||
-Wunused
|
|
||||||
-Woverloaded-virtual
|
|
||||||
-Wconversion
|
|
||||||
-Wmisleading-indentation
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wduplicated-branches
|
|
||||||
-Wlogical-op
|
|
||||||
-Wnull-dereference
|
|
||||||
-Wformat=2
|
|
||||||
-Wformat-overflow
|
|
||||||
-Wformat-truncation
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wundef
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-g3
|
|
||||||
-fsanitize=address,undefined
|
|
||||||
-fsanitize=float-divide-by-zero
|
|
||||||
-fsanitize=float-cast-overflow
|
|
||||||
-fno-sanitize-recover=all
|
|
||||||
-fstack-protector-all
|
|
||||||
-fstack-usage
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fno-inline
|
|
||||||
-ffunction-sections
|
|
||||||
-D_GLIBCXX_DEBUG
|
|
||||||
-D_GLIBCXX_DEBUG_PEDANTIC
|
|
||||||
-DLOCAL
|
|
||||||
-std=c++23
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
DBG_BIN="${BASE}.debug"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
DBG_BIN="build/$DBG_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$DBG_BIN" "$OUTPUT" @debug_flags.txt
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$DBG_BIN" "$INPUT" "$OUTPUT" true
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. ./scripts/utils.sh
|
|
||||||
|
|
||||||
SRC="$1"
|
|
||||||
BASE=$(basename "$SRC" .cc)
|
|
||||||
INPUT="${BASE}.in"
|
|
||||||
OUTPUT="${BASE}.out"
|
|
||||||
RUN_BIN="${BASE}.run"
|
|
||||||
|
|
||||||
test -d build || mkdir -p build
|
|
||||||
test -d io || mkdir -p io
|
|
||||||
|
|
||||||
test -f "$INPUT" && test ! -f "io/$INPUT" && mv "$INPUT" "io/"
|
|
||||||
test -f "$OUTPUT" && test ! -f "io/$OUTPUT" && mv "$OUTPUT" "io/"
|
|
||||||
|
|
||||||
test -f "io/$INPUT" || touch "io/$INPUT"
|
|
||||||
test -f "io/$OUTPUT" || touch "io/$OUTPUT"
|
|
||||||
|
|
||||||
INPUT="io/$INPUT"
|
|
||||||
OUTPUT="io/$OUTPUT"
|
|
||||||
RUN_BIN="build/$RUN_BIN"
|
|
||||||
|
|
||||||
compile_source "$SRC" "$RUN_BIN" "$OUTPUT" ""
|
|
||||||
CODE=$?
|
|
||||||
test $CODE -gt 0 && exit $CODE
|
|
||||||
|
|
||||||
execute_binary "$RUN_BIN" "$INPUT" "$OUTPUT"
|
|
||||||
exit $?
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
execute_binary() {
|
|
||||||
binary="$1"
|
|
||||||
input="$2"
|
|
||||||
output="$3"
|
|
||||||
is_debug="$4"
|
|
||||||
|
|
||||||
start=$(date '+%s.%N')
|
|
||||||
if [ -n "$is_debug" ]; then
|
|
||||||
asan="$(ldconfig -p | grep libasan.so | head -n1 | awk '{print $4}')"
|
|
||||||
LD_PRELOAD="$asan" timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
else
|
|
||||||
timeout 2s ./"$binary" <"$input" >"$output" 2>&1
|
|
||||||
fi
|
|
||||||
CODE=$?
|
|
||||||
end=$(date '+%s.%N')
|
|
||||||
truncate -s "$(head -n 1000 "$output" | wc -c)" "$output"
|
|
||||||
|
|
||||||
if [ $CODE -ge 124 ]; then
|
|
||||||
MSG=''
|
|
||||||
case $CODE in
|
|
||||||
124) MSG='TIMEOUT' ;;
|
|
||||||
128) MSG='SIGILL' ;;
|
|
||||||
130) MSG='SIGABRT' ;;
|
|
||||||
131) MSG='SIGBUS' ;;
|
|
||||||
136) MSG='SIGFPE' ;;
|
|
||||||
135) MSG='SIGSEGV' ;;
|
|
||||||
137) MSG='SIGPIPE' ;;
|
|
||||||
139) MSG='SIGTERM' ;;
|
|
||||||
esac
|
|
||||||
[ $CODE -ne 124 ] && sed -i '$d' "$output"
|
|
||||||
test -n "$MSG" && printf '\n[code]: %s (%s)' "$CODE" "$MSG" >>"$output"
|
|
||||||
else
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '\n[time]: %s ms' "$(awk "BEGIN {print ($end - $start) * 1000}")" >>$output
|
|
||||||
test -n "$is_debug" && is_debug_string=true || is_debug_string=false
|
|
||||||
printf '\n[debug]: %s' "$is_debug_string" >>$output
|
|
||||||
return $CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_source() {
|
|
||||||
src="$1"
|
|
||||||
bin="$2"
|
|
||||||
output="$3"
|
|
||||||
flags="$4"
|
|
||||||
|
|
||||||
test -f "$bin" && rm "$bin" || true
|
|
||||||
g++ @compile_flags.txt $flags "$src" -o "$bin" 2>"$output"
|
|
||||||
CODE=$?
|
|
||||||
|
|
||||||
if [ $CODE -gt 0 ]; then
|
|
||||||
printf '\n[code]: %s' "$CODE" >>"$output"
|
|
||||||
return $CODE
|
|
||||||
else
|
|
||||||
echo '' >"$output"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue