## Search found 12 matches

- Mon Sep 28, 2009 8:39 am
- Forum: Volume 116 (11600-11699)
- Topic: 11686 - Pick up sticks
- Replies:
**44** - Views:
**10471**

### Re: 11686 Runtime error Here

i solve the problem but getting Run Time error Please any body help me where the error occured My code is : #include<stdio.h> int main() { long int s[1000001][2]; blah blah... for(i=1;i<=n;i++) if(s [1]==0) { j=i; break; } printf("%ld\n",j); a=s[j][0]; for(;1;) { if(a==0) break; printf("%ld\n",a); ...

- Fri Sep 18, 2009 3:57 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11673 - Enemy at the Gateway
- Replies:
**2** - Views:
**740**

### Re: 11673 - Enemy at the Gateway

First the problem statement is messed up. You have to ignore the second "input output" explanation. But the last part is correct. Statements should read like this "given a N number of integrals [pi, qi] as described, and preamble n1,n2...,nP. find how many consecutive intervals that contains preambl...

- Thu Sep 10, 2009 6:08 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies:
**31** - Views:
**8591**

### Re: 11659 - Informants

because 3 isnt reliable and 2 isnt reliable ,so only 1 is reliable so ans is 1,its so simple problem,try all the I/Os in the board, :D :lol: 8) I think that the problem says that when an informant is not reliable, their words can be true or false, so I don't se a way of how 2 is not relieabe. Did I...

- Wed Sep 09, 2009 8:21 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies:
**31** - Views:
**8591**

### Re: 11659

"tryit1": can you put problem name when you creating new thread.tryit1 wrote:how to solve this problem ?

Can you post links to similar problems.

- Wed Sep 09, 2009 8:14 am
- Forum: Volume 116 (11600-11699)
- Topic: 11665 - Chinese Ink
- Replies:
**2** - Views:
**2207**

### Re: 11665 Chinese Ink

Could you make a test case then I will give you the correct answer.

By the way polygon intersects when

"Edges of polygons intersect" or "vertexes of a polygon are in an other polygon (fully covered) "

By the way polygon intersects when

"Edges of polygons intersect" or "vertexes of a polygon are in an other polygon (fully covered) "

- Sun Sep 06, 2009 10:48 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11664 - Langton's Ant
- Replies:
**10** - Views:
**3556**

### Re: 11664 - Langton's Ant

from cell(y,x)

north is y++

north is y++

- Sun Sep 06, 2009 1:12 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11661 - Burger Time?
- Replies:
**37** - Views:
**10625**

### Re: 11661 - Burger Time?

What an ugly code, why didn't you useMRH wrote:your given input my code give correct output but Again i gwt WA

plz help me.

thanks in advance

Code: Select all

```
?
Glance of my eyes tells that your reading input is incorrect. Try to read everything once. :wink:
```

- Thu Aug 27, 2009 5:07 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11651 - Krypton Number System
- Replies:
**5** - Views:
**3008**

### Re: 11651

any hints ? Make a graph. Lets say base of krypton number is 3. (digits 0,1,2) Initially we have a board is like this. . 0 1 2 0 x 1 4 1 1 x 1 2 4 1 x Now suppose we going 0 to 2 we need make score 4. Which means 3 dummy digits is necessary. Lets say them A(score 1), B(score 2), C(score 3). Then we...

- Thu Aug 27, 2009 4:44 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11654 - Arithmetic Subsequence
- Replies:
**6** - Views:
**2724**

### Re: 11654 - Arithmetic Subsequence

Same as yours got 0.364sec.Igor9669 wrote:Hi!

I solved this problem, but my runtime is very large(1.040 sec). I'm interesting in your solutions, what method do you use and what is the complexity of your algo? My algo is - O(n^3 logN).

- Sun Oct 26, 2008 1:00 am
- Forum: Volume 115 (11500-11599)
- Topic: 11538 - Chess Queen
- Replies:
**9** - Views:
**2171**

### Re: 11538 - Chess Queen

It is easy when N=1. You can find a formula.

Then you can find all possibilities horizontal and verticals.

After that you need to calculate diagonals (2 kind). The hardest thing might be the case N!=M.

Here is one formula you may use 1+4+9+...+n*n=n(n+1)(2n+1)/6

Good luck.

Then you can find all possibilities horizontal and verticals.

After that you need to calculate diagonals (2 kind). The hardest thing might be the case N!=M.

Here is one formula you may use 1+4+9+...+n*n=n(n+1)(2n+1)/6

Good luck.

- Mon Oct 20, 2008 10:50 am
- Forum: Volume 115 (11500-11599)
- Topic: 11525 - Permutation
- Replies:
**9** - Views:
**3302**

### Re: 11525 - Permutation

Done both idea

Using binary tree and splitting to subarrays.

But didn't understand why subarray method is faster than the other? Was it good test for this idea or generally it holds. Anyway best method might use binary tree because it is safe and usefull afterward.

Using binary tree and splitting to subarrays.

But didn't understand why subarray method is faster than the other? Was it good test for this idea or generally it holds. Anyway best method might use binary tree because it is safe and usefull afterward.

- Mon Oct 20, 2008 10:48 am
- Forum: Volume 115 (11500-11599)
- Topic: 11533 - Special Number
- Replies:
**8** - Views:
**3664**

### Re: 11533 - Special Number

Yes it can be such test.

I assume that in N-base number, maximum length of the special number is N^2.

So i loop at most N^2 times and checks it can be generated if not prints out "I give up "

I assume that in N-base number, maximum length of the special number is N^2.

So i loop at most N^2 times and checks it can be generated if not prints out "I give up "