File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 33from logging import Logger , basicConfig , getLogger
44from os import getenv
55from pathlib import Path
6+ from subprocess import run
67import zipfile
78
89logger : Logger = getLogger (__name__ )
910
11+ combined_cpp_main = """
12+ int main() {
13+ // write your code here
14+ return 0;
15+ }
16+ """
17+
1018if __name__ == "__main__" :
1119 basicConfig (
1220 format = "%(asctime)s [%(levelname)s] %(message)s" ,
1321 datefmt = "%H:%M:%S" ,
1422 level = getenv ('LOG_LEVEL' , 'INFO' ),
1523 )
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
1631 with zipfile .ZipFile ('ac-library.zip' , 'w' ) as zipf :
1732 langs = ['en' , 'ja' ]
1833 for lang in langs :
2742 for f in (Path ('..' ) / 'atcoder' ).glob ('*' ):
2843 zipf .write (f , f .relative_to (Path ('..' )))
2944
45+ zipf .write ('combined.cpp' , 'all_combined.cpp' );
46+
3047 zipf .write ('../expander.py' , 'expander.py' )
You can’t perform that action at this time.
0 commit comments