답안 #250527

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
250527 2020-07-18T09:00:26 Z dvdg6566 Popcount (COCI19_popcount) C++14
컴파일 오류
0 ms 0 KB
A=[int(x) for x in input().split(' ')]
N=A[0]
M=A[1]
X=[]	
ml=0
for x in range(M):
	A=0
	B=0
	for i in range(N):
		if((2**ml)&i): A+=2**i
		else:B+=2**i

	ml+=1
	X.append("A=((A&"+str(A)+")>>"+str(ml)+")+(A&"+str(B)+'))')
	if(2**ml>=N):break

print(len(X))
for i in X:
	print(i)

Compilation message

popcount.cpp:14:56: warning: multi-character character constant [-Wmultichar]
  X.append("A=((A&"+str(A)+")>>"+str(ml)+")+(A&"+str(B)+'))')
                                                        ^~~~
popcount.cpp:1:1: error: 'A' does not name a type
 A=[int(x) for x in input().split(' ')]
 ^