Панин Никита Александрович 417 ZipInfo 16122 | Утнасун Муниев, 514 группа ZipInfo 16368 | ||||
---|---|---|---|---|---|
f | 1 | import zipfile | f | 1 | import zipfile |
2 | import sys | 2 | import sys | ||
3 | import io | 3 | import io | ||
n | 4 | inp = sys.stdin.read() | n | 4 | input_zip = sys.stdin.read() |
5 | bytes_ = bytearray.fromhex(inp) | 5 | hex_to_byte = bytearray.fromhex(input_zip) | ||
6 | with zipfile.ZipFile(io.BytesIO(bytes_), 'r') as zf: | 6 | with zipfile.ZipFile(io.BytesIO(hex_to_byte), 'r') as zp: | ||
7 | files = [] | 7 | files = [] | ||
t | 8 | for f in zf.filelist: | t | 8 | for i in zp.filelist: |
9 | if not f.is_dir(): | 9 | if not i.is_dir(): | ||
10 | files.append(f) | 10 | files.append(i) | ||
11 | zsize = 0 | 11 | sum = 0 | ||
12 | for f in files: | 12 | for i in files: | ||
13 | zsize += f.file_size | 13 | sum += i.file_size | ||
14 | print(len(files), zsize) | 14 | print(len(files), sum) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|