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