## Search found 23 matches

- Thu Jun 12, 2008 3:20 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11190 - Series of Powers
- Replies:
**18** - Views:
**11427**

### Re: 11190 - Series of Powers

It should be accepted within time limit with complexity O(n lg k) if the n = |h - l| that you mean. BCOZ there are almost 1500 test cases and the worst case for each case : 1000*24. Hence, it always pass the time limit successfully. The complexity of my solution is O(n) where n = |h - l| which alway...

- Thu Jun 12, 2008 3:00 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11173 - Grey Codes
- Replies:
**5** - Views:
**4839**

### Re: 11173 - Grey Codes

You can solve this problem using some bitwise operation.

For more details:

Read the following book:

Art of Computer programming by Donald Knuth (Volume-4)

For more details:

Read the following book:

Art of Computer programming by Donald Knuth (Volume-4)

- Thu Jun 12, 2008 2:39 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11191 - Square
- Replies:
**23** - Views:
**13597**

### Re: 11191 - Perfect Square

I changed the following part of your code and get it accepted. Your code: int n,i,j,u,v; long long m,zero; I changed that part: int i,j,u,v; long long n, m,zero; For your regards: 1. After accepted, you should remove your code from the post. 2. If you cofuse about the limit of number or range of num...

- Sat Dec 01, 2007 5:19 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11355 - Cool Points
- Replies:
**8** - Views:
**3678**

- Sat Dec 01, 2007 11:27 am
- Forum: Volume 113 (11300-11399)
- Topic: 11355 - Cool Points
- Replies:
**8** - Views:
**3678**

### 11355 - Cool Points

I got WA infinite times in this problem.

Can anybody help me who got ACC?

I post my code to verify why this got WA.

I assure that I will cut my code just see the accepted.

Thanks in advance.

Can anybody help me who got ACC?

I post my code to verify why this got WA.

Code: Select all

```
Cut After ACC
```

Thanks in advance.

- Sat Sep 29, 2007 10:23 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11291 - Smeech
- Replies:
**8** - Views:
**3452**

### 11291 - Smeech

Can anyone explain what should do in this problem?

I cannot find the meaning of the following statement:

I cannot find the meaning of the following statement:

How can be p used for the statement?With probability p, (p e1 e2) represents x+y where x is the value of e1 and y is the value of e2; otherwise it represents x-y.

- Tue Sep 25, 2007 5:27 am
- Forum: Volume 112 (11200-11299)
- Topic: 11266 - Equations
- Replies:
**15** - Views:
**5351**

Thanks Jan and everybody who posts in this thread. After get several wrong answer I couldn't find my bug. So, ask this kind of question. But now I got it accepted after finding silly bug in my code. problem is my nCr function. This function couldn't work with handing overflow. Thanks again everybody.

- Sun Sep 23, 2007 11:16 am
- Forum: Volume 112 (11200-11299)
- Topic: 11266 - Equations
- Replies:
**15** - Views:
**5351**

I have got the idea what should do. I use exclusion-inclusion to find the desired output. What should I do for the following case: Solutions are {1, 2, 3}, {1, 3, 2} . Should I count twice for these solution set? Can anyone explain why this case answer : 121326 Case: 10 50000 -10000 10000 -10000 100...

- Wed Sep 12, 2007 9:26 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11236 - Grocery store
- Replies:
**9** - Views:
**4834**

O(n^3) certainly get Time Limit Exceed. But not much time to crash a PC. After running and print the solution you will see that: Maximum value for a, b, c is 125, 592, 884. So, the complexity of the algorithm reduces in O(max(a)*max(b)*max(c)). Now, This will pass the TLE. Other, There is huge pruni...

- Wed Sep 12, 2007 7:43 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies:
**22** - Views:
**11573**

- Wed Sep 12, 2007 5:03 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies:
**22** - Views:
**11573**

I tested your input and output in my two different codes that both are accepted. And I found the same output as yours. We cannot have negative numbers as input, right? Yes. You are correct. In my accepted codes cannot handle negative numbers. I assume in my program that the correct inputs are intege...

- Wed Sep 12, 2007 4:36 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11261 - Bishops
- Replies:
**13** - Views:
**3809**

Here some random input and output. These may be helpful for u. INPUT: 11 760 10 65 123 32 654 132 458 325 187 256 325 25 63 7 9 3 6 65 45 12 99 10000 30 1 10000 2 6 5 3 4 98 9 8 365 4589 321 6548 356 10000 789 987 487 789 452 326 12 99 99 65 99 45 54 89 89 89 569 100 100 6547 6589 1000 3254 9872 456...

- Tue Sep 11, 2007 9:29 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies:
**22** - Views:
**11573**

My AC code returns 82064896 for Piklu_sust's last input. INPUT: Code: 4611686018427387903 0 CORRECT OUTPUT: Code: 82064896 I give the output from running my acc program. I debug my code and see you are right. But I get accepted because there is no input like that. My problem is rounding error. But ...

- Tue Sep 11, 2007 5:14 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11254 - Consecutive Integers
- Replies:
**24** - Views:
**11921**

Anyone who don't get ACC or idea to solve this problem:

Just read the following article:

Partitions into Consecutive Integers

http://www.mathpages.com/home/kmath107.htm

I think it will be helpful for solving the problem.

Just read the following article:

Partitions into Consecutive Integers

http://www.mathpages.com/home/kmath107.htm

I think it will be helpful for solving the problem.

- Tue Sep 11, 2007 5:04 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11260 - Odd Root Sum
- Replies:
**22** - Views:
**11573**

There is occur overflow. You should use modular theorem in each step of addition and multiplication. Here is some input and output: INPUT: 1 2 3 1000000000 9223372036854775807 100000000000000000 99999999999999999 123654789 1234567890 9876543210 4611686018427387903 0 YOUR OUTPUT: 1 1 2 75541908 -4467...