Submission #250532

# Submission time Handle Problem Language Result Execution time Memory
250532 2020-07-18T09:04:15 Z dvdg6566 Popcount (COCI19_popcount) Python 3
110 / 110
32 ms 3436 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

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

print(len(X))
for i in X:
	print(i)
# Verdict Execution time Memory Grader output
1 Correct 21 ms 3308 KB Accepted.
2 Correct 29 ms 3380 KB Accepted.
3 Correct 20 ms 3308 KB Accepted.
4 Correct 26 ms 3308 KB Accepted.
5 Correct 23 ms 3308 KB Accepted.
6 Correct 20 ms 3308 KB Accepted.
7 Correct 19 ms 3308 KB Accepted.
8 Correct 20 ms 3300 KB Accepted.
9 Correct 22 ms 3308 KB Accepted.
10 Correct 21 ms 3308 KB Accepted.
11 Correct 21 ms 3300 KB Accepted.
12 Correct 20 ms 3308 KB Accepted.
13 Correct 20 ms 3308 KB Accepted.
14 Correct 30 ms 3300 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 27 ms 3320 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 20 ms 3308 KB Accepted.
2 Correct 32 ms 3308 KB Accepted.
3 Correct 20 ms 3308 KB Accepted.
4 Correct 20 ms 3308 KB Accepted.
5 Correct 19 ms 3360 KB Accepted.
6 Correct 20 ms 3308 KB Accepted.
7 Correct 20 ms 3308 KB Accepted.
8 Correct 20 ms 3308 KB Accepted.
9 Correct 20 ms 3308 KB Accepted.
10 Correct 21 ms 3308 KB Accepted.
11 Correct 20 ms 3308 KB Accepted.
12 Correct 20 ms 3308 KB Accepted.
13 Correct 20 ms 3308 KB Accepted.
14 Correct 20 ms 3308 KB Accepted.
15 Correct 20 ms 3308 KB Accepted.
16 Correct 20 ms 3308 KB Accepted.
17 Correct 22 ms 3300 KB Accepted.
18 Correct 22 ms 3300 KB Accepted.
19 Correct 25 ms 3300 KB Accepted.
20 Correct 20 ms 3292 KB Accepted.
21 Correct 21 ms 3308 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 23 ms 3436 KB Accepted.
2 Correct 24 ms 3308 KB Accepted.
3 Correct 27 ms 3308 KB Accepted.
4 Correct 26 ms 3336 KB Accepted.
5 Correct 22 ms 3308 KB Accepted.
6 Correct 21 ms 3308 KB Accepted.
7 Correct 21 ms 3308 KB Accepted.
8 Correct 23 ms 3308 KB Accepted.
9 Correct 22 ms 3308 KB Accepted.
10 Correct 22 ms 3380 KB Accepted.
11 Correct 22 ms 3292 KB Accepted.
12 Correct 27 ms 3336 KB Accepted.