提出 #75751858


ソースコード 拡げる

import sys
input = sys.stdin.readline
from random import choice

n,m = map(int,input().split())
L = []
f0,f1 = True,True
for _ in range(n):
    s = input().rstrip()
    zero,one = False,False
    for i in s:
        if i == '0': zero = True
        if i == '1': one = True
    if not zero: f0 = False
    if not one: f1 = False
    L.append(int(s,2))

if f0:
    print('Yes')
    print('0'*m)
elif f1:
    print('Yes')
    print('1'*m)
elif m < 15:
    for x in range(1<<m):
        for i in L:
            if i^x == (1<<m)-1:
                break
        else:
            print('Yes')
            x = bin(x)[2:]
            l = len(x)
            print('0'*(m-l)+x)
            exit()
    print('No')
else:
    i = 0
    while i < 10:
        x = ''.join(choice('01') for _ in range(m))
        y = int(x,2)
        for a in L:
            if a^y == (1<<m)-1:
                break
        else:
            print('Yes')
            print(x)
            exit()
        i += 1
    print('No')

提出情報

提出日時
問題 A - Similarity
ユーザ Cenix820
言語 Python (PyPy 3.11-v7.3.20)
得点 400
コード長 1042 Byte
結果 AC
実行時間 363 ms
メモリ 110872 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 62
セット名 テストケース
Sample 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt
All 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-allbut-01.txt, 01-allbut-02.txt, 01-allbut-03.txt, 01-allbut-04.txt, 01-allbut-05.txt, 01-allbut-06.txt, 01-allbut-07.txt, 01-allbut-08.txt, 01-allbut-09.txt, 01-allbut-10.txt, 01-allbut-11.txt, 01-allbut-12.txt, 01-allbut-13.txt, 01-allbut-14.txt, 01-allbut-15.txt, 01-allbut-16.txt, 01-allbut-17.txt, 01-allbut-18.txt, 01-allbut-19.txt, 01-allbut-20.txt, 01-allbut-21.txt, 01-allbut-22.txt, 01-allbut-23.txt, 01-allbut-24.txt, 01-allbut-25.txt, 02-all-01.txt, 02-all-02.txt, 02-all-03.txt, 02-all-04.txt, 02-all-05.txt, 02-all-06.txt, 02-all-07.txt, 02-all-08.txt, 03-random-01.txt, 03-random-02.txt, 03-random-03.txt, 03-random-04.txt, 03-random-05.txt, 03-random-06.txt, 03-random-07.txt, 03-random-08.txt, 03-random-09.txt, 03-random-10.txt, 03-random-11.txt, 03-random-12.txt, 03-random-13.txt, 03-random-14.txt, 04-killer-01.txt, 04-killer-02.txt, 04-killer-03.txt, 04-killer-04.txt, 04-killer-05.txt, 04-killer-06.txt, 04-killer-07.txt, 04-killer-08.txt, 05-random2-01.txt, 05-random2-02.txt, 05-random2-03.txt, 05-random2-04.txt
ケース名 結果 実行時間 メモリ
00-sample-01.txt AC 67 ms 95656 KiB
00-sample-02.txt AC 66 ms 95812 KiB
00-sample-03.txt AC 67 ms 95960 KiB
01-allbut-01.txt AC 67 ms 95884 KiB
01-allbut-02.txt AC 66 ms 95812 KiB
01-allbut-03.txt AC 66 ms 95924 KiB
01-allbut-04.txt AC 66 ms 95720 KiB
01-allbut-05.txt AC 67 ms 95920 KiB
01-allbut-06.txt AC 66 ms 95812 KiB
01-allbut-07.txt AC 67 ms 95736 KiB
01-allbut-08.txt AC 66 ms 95732 KiB
01-allbut-09.txt AC 66 ms 95744 KiB
01-allbut-10.txt AC 66 ms 95824 KiB
01-allbut-11.txt AC 67 ms 95872 KiB
01-allbut-12.txt AC 68 ms 96016 KiB
01-allbut-13.txt AC 69 ms 95988 KiB
01-allbut-14.txt AC 68 ms 95892 KiB
01-allbut-15.txt AC 70 ms 102360 KiB
01-allbut-16.txt AC 82 ms 109084 KiB
01-allbut-17.txt AC 86 ms 109048 KiB
01-allbut-18.txt AC 89 ms 109228 KiB
01-allbut-19.txt AC 82 ms 109084 KiB
01-allbut-20.txt AC 83 ms 109016 KiB
01-allbut-21.txt AC 132 ms 109256 KiB
01-allbut-22.txt AC 83 ms 108724 KiB
01-allbut-23.txt AC 84 ms 108676 KiB
01-allbut-24.txt AC 203 ms 109280 KiB
01-allbut-25.txt AC 287 ms 109500 KiB
02-all-01.txt AC 67 ms 95736 KiB
02-all-02.txt AC 66 ms 95748 KiB
02-all-03.txt AC 66 ms 95984 KiB
02-all-04.txt AC 69 ms 102112 KiB
02-all-05.txt AC 76 ms 107396 KiB
02-all-06.txt AC 97 ms 108844 KiB
02-all-07.txt AC 152 ms 108848 KiB
02-all-08.txt AC 363 ms 109096 KiB
03-random-01.txt AC 69 ms 95872 KiB
03-random-02.txt AC 77 ms 105696 KiB
03-random-03.txt AC 78 ms 108988 KiB
03-random-04.txt AC 86 ms 109164 KiB
03-random-05.txt AC 81 ms 108748 KiB
03-random-06.txt AC 87 ms 109136 KiB
03-random-07.txt AC 90 ms 109320 KiB
03-random-08.txt AC 92 ms 109304 KiB
03-random-09.txt AC 96 ms 108924 KiB
03-random-10.txt AC 99 ms 109244 KiB
03-random-11.txt AC 103 ms 109980 KiB
03-random-12.txt AC 116 ms 110872 KiB
03-random-13.txt AC 119 ms 110320 KiB
03-random-14.txt AC 117 ms 110320 KiB
04-killer-01.txt AC 121 ms 110656 KiB
04-killer-02.txt AC 116 ms 110620 KiB
04-killer-03.txt AC 114 ms 109800 KiB
04-killer-04.txt AC 118 ms 110592 KiB
04-killer-05.txt AC 122 ms 110536 KiB
04-killer-06.txt AC 121 ms 110280 KiB
04-killer-07.txt AC 123 ms 110564 KiB
04-killer-08.txt AC 120 ms 110760 KiB
05-random2-01.txt AC 86 ms 109116 KiB
05-random2-02.txt AC 90 ms 108964 KiB
05-random2-03.txt AC 213 ms 109188 KiB
05-random2-04.txt AC 189 ms 109136 KiB