제출 #517323

#제출 시각아이디문제언어결과실행 시간메모리
517323KoDPopcount (COCI19_popcount)Cpython 3
110 / 110
24 ms2872 KiB
n, m = map(int, input().split())
if n == 1:
    print(1)
    print('A=A')
    exit()
k = 1
ans=[]
while k < n:
    s = ''
    while len(s) < n:
        s += '1' * k
        s += '0' * k
    b = int((s[:n])[::-1], 2)
    ans.append('A=((A&{})+((A>>{})&{}))'.format(b, k, b))
    k *= 2
print(len(ans))
print(*ans,sep='\n')
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...