Comments

M_Abu_Bakr_Shahid for some reason got disabled

The user is disabled...

Register me

Yeah, I know that number of divisors is $$$O(\sqrt[3]{k})$$$. But I also interested in sum of ones in binary representation.

For example: k = 6

1: 001, number of ones is 1

2: 010, 1

3: 011, 2

6: 110, 2

So, $$$X = 1 + 1 + 2 + 2 = 6$$$. It seems in the worst case my solution should work in $$$O(n^{3} \sqrt[3]{k} \log{k})$$$ and get TL. Yeah, $$$O(n^3 \sqrt[3]{n})$$$ also shouldn't pass. (probably it passed, because of weak test cases).

What is the worst case for the sum of sum of ones in binary representation of all divisors of $$$k (1 \lt = k \lt = 10^9)$$$? I wrote solution in F that works $$$O(n^3*X)$$$, where $$$X$$$ is the sum I mentioned before. (My submission)

UPD: I figured out, that instead of using all divisors, I could just used $$$k$$$. But the solution above also passed.

I'm getting the same error(

I'm an idiot... Edges can't repeat in a cycle. Why I even thought otherwise? It happens sometimes I guess...

I can't understand one thing in editorial of problem A. We assume that cycle must contain 4 edges. But what if we had graph where (1, 2) = 1; (1, 3) = 1 (1, 4) = 1 and other edges equals to 1000. Then we have cycle 1->2->1->3->1->4->1 that passes through all vertices, but not only once.

830C - Bamboo Partition weak test cases. Solution provided in editorial 28572941 gives different answer compared to my solution 356538530 on the following test:

3 3 
1 1 3

My solution gives $$$2$$$, and other gives $$$1$$$.

If you need generator:

#include <iostream>

using namespace std;

int main() {
    cout << "3 3" << endl;
    cout << "1 1 3" << endl;
}

Submission: 28572941

Expected verdict: Wrong answer