Саргсян Тачат 321 FragEncode 9204
Тимофей Сухорученков, 418 группа FragEncode 8780
f1import sysf1import sys
2data = sys.stdin.buffer.read()2data = sys.stdin.buffer.read()
n3parts = data.split(b'\x00')n3fragments = data.split(b'\x00')
4original_text = parts[0].decode('utf-8')4text_utf8 = fragments[0].decode('utf-8')
5fragments = parts[1:]5check_fragments = fragments[1:]
6encodings = ['cp866', 'cp1251', 'koi8-r', 'iso8859-5']6encodings = ['cp866', 'cp1251', 'koi8-r', 'iso-8859-5']
7for fragment in fragments:7for frag in check_fragments:
8    if not fragment:8    if not frag:
9        continue9        continue
10    found = False10    found = False
n11    for encoding in encodings:n11    for enc in encodings:
12        try:12        try:
t13            decoded_fragment = fragment.decode(encoding)t13            s = frag.decode(enc)
14            if decoded_fragment in original_text:14            if s in text_utf8:
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