Submission #222520

# Submission time Handle Problem Language Result Execution time Memory
222520 2020-04-13T08:37:18 Z dwsc Popcount (COCI19_popcount) Python 3
110 / 110
38 ms 3500 KB
n,k= input().split(" ")
n = int(n)
k = int(k)
numboxes = n
boxsize = 1
val =0
tempn = n
while (tempn != 1):
    val+= 1
    tempn = (tempn+1)//2
print(val)
while numboxes != 1:
    bigbox = 0
    smallbox = 0
    addto = 0
    num = 0
    counter = 1
    for i in range(0,n):
        num += 1
        if (num > boxsize):
            num -= boxsize
            addto = 1-addto
        if (addto):
            bigbox += counter
        else:
            smallbox += counter
        counter *= 2
    print("A=(((A&"+str(bigbox)+")>>"+str(boxsize)+")+(A&"+str(smallbox)+"))")
    numboxes = (numboxes+1)//2
    boxsize *= 2
# Verdict Execution time Memory Grader output
1 Correct 25 ms 3308 KB Accepted.
2 Correct 24 ms 3372 KB Accepted.
3 Correct 36 ms 3300 KB Accepted.
4 Correct 25 ms 3308 KB Accepted.
5 Correct 31 ms 3292 KB Accepted.
6 Correct 25 ms 3300 KB Accepted.
7 Correct 25 ms 3284 KB Accepted.
8 Correct 26 ms 3300 KB Accepted.
9 Correct 26 ms 3308 KB Accepted.
10 Correct 25 ms 3308 KB Accepted.
11 Correct 38 ms 3300 KB Accepted.
12 Correct 26 ms 3372 KB Accepted.
13 Correct 26 ms 3308 KB Accepted.
14 Correct 25 ms 3308 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 28 ms 3324 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3372 KB Accepted.
2 Correct 25 ms 3364 KB Accepted.
3 Correct 25 ms 3308 KB Accepted.
4 Correct 24 ms 3364 KB Accepted.
5 Correct 25 ms 3308 KB Accepted.
6 Correct 30 ms 3308 KB Accepted.
7 Correct 24 ms 3308 KB Accepted.
8 Correct 25 ms 3308 KB Accepted.
9 Correct 25 ms 3308 KB Accepted.
10 Correct 33 ms 3376 KB Accepted.
11 Correct 25 ms 3308 KB Accepted.
12 Correct 25 ms 3308 KB Accepted.
13 Correct 25 ms 3308 KB Accepted.
14 Correct 25 ms 3308 KB Accepted.
15 Correct 24 ms 3308 KB Accepted.
16 Correct 24 ms 3300 KB Accepted.
17 Correct 27 ms 3300 KB Accepted.
18 Correct 26 ms 3332 KB Accepted.
19 Correct 24 ms 3308 KB Accepted.
20 Correct 25 ms 3300 KB Accepted.
21 Correct 24 ms 3500 KB Accepted.
# Verdict Execution time Memory Grader output
1 Correct 25 ms 3308 KB Accepted.
2 Correct 26 ms 3308 KB Accepted.
3 Correct 27 ms 3324 KB Accepted.
4 Correct 27 ms 3324 KB Accepted.
5 Correct 26 ms 3308 KB Accepted.
6 Correct 24 ms 3300 KB Accepted.
7 Correct 25 ms 3372 KB Accepted.
8 Correct 26 ms 3308 KB Accepted.
9 Correct 25 ms 3308 KB Accepted.
10 Correct 28 ms 3372 KB Accepted.
11 Correct 26 ms 3308 KB Accepted.
12 Correct 28 ms 3336 KB Accepted.