Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a2e6162

Browse files
adds a new .sh file to export all your problem and solution links in csv
1 parent 8ebe02b commit a2e6162

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎scripts/makeExcel.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Directory containing your solutions
4+
DIR="./solutions_codForces"
5+
6+
# Output CSV file
7+
OUTPUT_FILE="problems.csv"
8+
9+
# CSV header
10+
echo "Problem Link,Intuition,Submission Link" > "$OUTPUT_FILE"
11+
12+
# Loop through all matching files
13+
for file in "$DIR"/*; do
14+
filename=$(basename "$file")
15+
16+
# Match pattern: submission_id_contest_id_problem.ext
17+
if [[ $filename =~ ^([0-9]+)_([0-9]+)_([A-Z][0-9]*|[A-Z])\..+$ ]]; then
18+
submission_id="${BASH_REMATCH[1]}"
19+
contest_id="${BASH_REMATCH[2]}"
20+
problem_code="${BASH_REMATCH[3]}"
21+
22+
problem_link="https://codeforces.com/problemset/problem/${contest_id}/${problem_code}"
23+
submission_link="https://codeforces.com/contest/${contest_id}/submission/${submission_id}"
24+
25+
# Output as CSV row
26+
echo "\"$problem_link\",\"\",\"$submission_link\"" >> "$OUTPUT_FILE"
27+
fi
28+
done
29+
30+
echo "CSV file '$OUTPUT_FILE' created."

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /