forked from mrsac7/CSES-Solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
21 lines (20 loc) · 766 Bytes
/
script.py
File metadata and controls
21 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
for dname, dirs, files in os.walk(r"C:\Users\berna\Unicamp\Competitive Programming\CSES\CSES-Solutions\src"):
for fname in files:
num = fname[0:4]
nome = fname[7:len(fname) - 4]
fpath = os.path.join(dname, fname)
with open(fpath) as f:
s = f.read()
s = s.replace("""/*
Problem Name: {nome}
Problem Link: https://cses.fi/problemset/task/{num}
Author: Bernardo Archegas (https://codeforces.com/profile/Ber)
*/""".format(nome = nome, num = num), """// {nome}
//
// Problem name: {nome}
// Problem Link: https://cses.fi/problemset/task/{num}
// Author: Bernardo Archegas (https://codeforces.com/profile/Ber)
""".format(nome = nome, num = num))
with open(fpath, "w") as f:
f.write(s)