Тимофей Сухорученков, 418 группа FragEncode 8780
Саргсян Тачат 321 FragEncode 9204
f1import sysf1import sys
2data = sys.stdin.buffer.read()2data = sys.stdin.buffer.read()
n3fragments = data.split(b'\x00')n3parts = data.split(b'\x00')
4text_utf8 = fragments[0].decode('utf-8')4original_text = parts[0].decode('utf-8')
5check_fragments = fragments[1:]5fragments = parts[1:]
6encodings = ['cp866', 'cp1251', 'koi8-r', 'iso-8859-5']6encodings = ['cp866', 'cp1251', 'koi8-r', 'iso8859-5']
7for frag in check_fragments:7for fragment in fragments:
8    if not frag:8    if not fragment:
9        continue9        continue
10    found = False10    found = False
n11    for enc in encodings:n11    for encoding in encodings:
12        try:12        try:
t13            s = frag.decode(enc)t13            decoded_fragment = fragment.decode(encoding)
14            if s in text_utf8:14            if decoded_fragment in original_text:
15                found = True15                found = True
16                break16                break
17        except UnicodeDecodeError:17        except UnicodeDecodeError:
18            continue18            continue
19    print('Yes' if found else 'No')19    print('Yes' if found else 'No')
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op