Skip to content

Commit 5f29ecd

Browse files
committed
feat: add script to reorganize input files
1 parent ddf0f00 commit 5f29ecd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

move_input.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import shutil
2+
from pathlib import Path
3+
4+
def move_input_files():
5+
# Define root path
6+
root = Path.cwd()
7+
uva_root = root / 'uva'
8+
9+
# List of input files to move (based on provided find output)
10+
input_files = [
11+
'uva/src/main/resources/uva/p1589/3.in',
12+
'uva/src/main/resources/uva/p10000/3.in',
13+
'uva/src/main/resources/uva/p11624/3.in'
14+
]
15+
16+
for file_path in input_files:
17+
src_file = Path(file_path)
18+
if src_file.exists():
19+
# Extract problem number from the path (e.g., p1589 -> 1589)
20+
problem = src_file.parent.name[1:] # Remove 'p' prefix
21+
target_dir = uva_root / problem
22+
target_file = target_dir / src_file.name
23+
24+
# Create target directory if it doesn't exist
25+
target_dir.mkdir(parents=True, exist_ok=True)
26+
27+
# Move the file
28+
shutil.move(str(src_file), str(target_file))
29+
print(f'Moved {src_file} to {target_file}')
30+
else:
31+
print(f'File {src_file} not found, skipping')
32+
33+
if __name__ == '__main__':
34+
move_input_files()
35+
print('Input file reorganization complete.')

0 commit comments

Comments
 (0)