-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalgo
executable file
·49 lines (34 loc) · 834 Bytes
/
algo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
if [ $# -eq 0 ]; then
echo "Usage: algo <folder_name1> [<folder_name2> ...]"
exit 1
fi
for folder_name in "$@"; do
# Create the directory
mkdir "$folder_name"
# Change to the directory
cd "$folder_name" || exit 1
# Create the cpp file
echo \
"#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int, int> P;
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
int main(void)
{
ios::sync_with_stdio(false), cin.tie(nullptr);
return 0;
}" > "$folder_name.cpp"
# Create the README file
today_date=$(date +'%Y-%m-%d')
echo "# [$folder_name](https://www.acmicpc.net/problem/$folder_name)
solved on: $today_date
## Solutions
-
## References" > "README.md"
echo "Folder '$folder_name' has been created."
# Move back to the original directory
cd ..
done