Submission #517323

# Submission time Handle Problem Language Result Execution time Memory
517323 2022-01-23T03:53:40 Z KoD Popcount (COCI19_popcount) Python 3
110 / 110
24 ms 2872 KB
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 time Memory Grader output
1 Correct 13 ms 2764 KB Accepted.
2 Correct 19 ms 2840 KB Accepted.
3 Correct 13 ms 2764 KB Accepted.
4 Correct 13 ms 2820 KB Accepted.
5 Correct 13 ms 2764 KB Accepted.
6 Correct 16 ms 2780 KB Accepted.
7 Correct 13 ms 2824 KB Accepted.
8 Correct 13 ms 2764 KB Accepted.
9 Correct 15 ms 2840 KB Accepted.
10 Correct 16 ms 2768 KB Accepted.
11 Correct 16 ms 2764 KB Accepted.
12 Correct 14 ms 2800 KB Accepted.
13 Correct 14 ms 2764 KB Accepted.
14 Correct 15 ms 2740 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 22 ms 2788 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 13 ms 2764 KB Accepted.
2 Correct 14 ms 2840 KB Accepted.
3 Correct 12 ms 2840 KB Accepted.
4 Correct 14 ms 2800 KB Accepted.
5 Correct 14 ms 2752 KB Accepted.
6 Correct 16 ms 2764 KB Accepted.
7 Correct 17 ms 2764 KB Accepted.
8 Correct 16 ms 2836 KB Accepted.
9 Correct 17 ms 2796 KB Accepted.
10 Correct 12 ms 2764 KB Accepted.
11 Correct 15 ms 2836 KB Accepted.
12 Correct 17 ms 2816 KB Accepted.
13 Correct 14 ms 2764 KB Accepted.
14 Correct 14 ms 2788 KB Accepted.
15 Correct 24 ms 2764 KB Accepted.
16 Correct 21 ms 2752 KB Accepted.
17 Correct 13 ms 2720 KB Accepted.
18 Correct 15 ms 2736 KB Accepted.
19 Correct 15 ms 2764 KB Accepted.
20 Correct 17 ms 2756 KB Accepted.
21 Correct 13 ms 2816 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 14 ms 2840 KB Accepted.
2 Correct 19 ms 2764 KB Accepted.
3 Correct 15 ms 2800 KB Accepted.
4 Correct 14 ms 2764 KB Accepted.
5 Correct 19 ms 2764 KB Accepted.
6 Correct 14 ms 2808 KB Accepted.
7 Correct 20 ms 2764 KB Accepted.
8 Correct 14 ms 2828 KB Accepted.
9 Correct 16 ms 2764 KB Accepted.
10 Correct 19 ms 2848 KB Accepted.
11 Correct 18 ms 2872 KB Accepted.
12 Correct 18 ms 2784 KB Accepted.