File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 3
3
from logging import Logger , basicConfig , getLogger
4
4
from os import getenv
5
5
from pathlib import Path
6
+ from subprocess import run
6
7
import zipfile
7
8
8
9
logger : Logger = getLogger (__name__ )
9
10
11
+ combined_cpp_main = """
12
+ int main() {
13
+ // write your code here
14
+ return 0;
15
+ }
16
+ """
17
+
10
18
if __name__ == "__main__" :
11
19
basicConfig (
12
20
format = "%(asctime)s [%(levelname)s] %(message)s" ,
13
21
datefmt = "%H:%M:%S" ,
14
22
level = getenv ('LOG_LEVEL' , 'INFO' ),
15
23
)
24
+
25
+ # generate all_combined.cpp
26
+ run (['../expander.py' , '../atcoder/all' , '--lib' , '..' ])
27
+ with open ('combined.cpp' , 'a' ) as f :
28
+ f .writelines (combined_cpp_main )
29
+
30
+ # generate zip
16
31
with zipfile .ZipFile ('ac-library.zip' , 'w' ) as zipf :
17
32
langs = ['en' , 'ja' ]
18
33
for lang in langs :
27
42
for f in (Path ('..' ) / 'atcoder' ).glob ('*' ):
28
43
zipf .write (f , f .relative_to (Path ('..' )))
29
44
45
+ zipf .write ('combined.cpp' , 'all_combined.cpp' );
46
+
30
47
zipf .write ('../expander.py' , 'expander.py' )
You can’t perform that action at this time.
0 commit comments