Submission #517316

# Submission time Handle Problem Language Result Execution time Memory
517316 2022-01-23T03:15:34 Z KoD Popcount (COCI19_popcount) Python 3
75 / 110
15 ms 2892 KB
from audioop import reverse


n, m = map(int, input().split())
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 time Memory Grader output
1 Correct 13 ms 2820 KB Accepted.
2 Correct 13 ms 2856 KB Accepted.
3 Correct 14 ms 2812 KB Accepted.
4 Correct 12 ms 2804 KB Accepted.
5 Correct 14 ms 2764 KB Accepted.
6 Correct 13 ms 2764 KB Accepted.
7 Correct 15 ms 2760 KB Accepted.
8 Correct 13 ms 2764 KB Accepted.
9 Correct 13 ms 2856 KB Accepted.
10 Correct 13 ms 2764 KB Accepted.
11 Correct 13 ms 2860 KB Accepted.
12 Correct 12 ms 2764 KB Accepted.
13 Correct 14 ms 2764 KB Accepted.
14 Correct 13 ms 2764 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 14 ms 2856 KB Accepted.
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2892 KB Incorrect number of commands.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 15 ms 2856 KB Accepted.
2 Correct 13 ms 2796 KB Accepted.
3 Correct 13 ms 2764 KB Accepted.
4 Correct 13 ms 2764 KB Accepted.
5 Correct 13 ms 2764 KB Accepted.
6 Correct 13 ms 2764 KB Accepted.
7 Correct 13 ms 2764 KB Accepted.
8 Correct 15 ms 2764 KB Accepted.
9 Correct 13 ms 2764 KB Accepted.
10 Correct 14 ms 2764 KB Accepted.
11 Correct 13 ms 2856 KB Accepted.
12 Correct 13 ms 2756 KB Accepted.