## Search found 13 matches

- Thu Mar 26, 2009 4:44 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10679 - I Love Strings!!
- Replies:
**101** - Views:
**49100**

### Re: 10679 - I love Strings!!!

You can't get AC with KMP in this problem! Actually you don't need KMP :) Fortunately ( or unfortunately :-? ) the judge data is wrong and funny ( sorry to say that ) You can get AC just by checking whether t is a prefix of st or not! Just check the first strlen(t) characters of st . By the way, you...

- Sat Mar 14, 2009 10:26 am
- Forum: Volume 4 (400-499)
- Topic: 482 - Permutation Arrays
- Replies:
**159** - Views:
**32376**

### Re: 482 Permutation Arrays

I think you have to change your method of "input taking" for second input line. you can use the value of i to take the second line. Note that, you will be given exactly i floating point numbers. So, you don't need to worry about the white spaces. You get the value of i from the while loop that takes...

- Thu Mar 12, 2009 10:38 am
- Forum: Volume 1 (100-199)
- Topic: 190 - Circle Through Three Points
- Replies:
**126** - Views:
**21838**

### Re: 190-Circle Through Three Points

well... I got AC by printing blank line after each testcases, but got WA by printing blank line between testcases.

- Wed Mar 11, 2009 6:04 pm
- Forum: Volume 1 (100-199)
- Topic: 190 - Circle Through Three Points
- Replies:
**126** - Views:
**21838**

### Re: 190-Circle Through Three Points

Try this:"Print a single blank line after each equation pair."

Code: Select all

```
0.0 0.0 1.0 0.0 0.0 2.0
```

Code: Select all

```
(x - 0.500)^2 + (y - 1.000)^2 = 1.118^2
x^2 + y^2 - 1.000x - 2.000y - 0.000 = 0
```

- Mon Feb 23, 2009 8:08 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11572 - Unique Snowflakes
- Replies:
**36** - Views:
**12869**

### Re: 11572 - Unique Snowflakes

I am having an impression that, you did the same mistake as I did. At first, I misunderstood the problem statement. The problem asks to find the highest number of unique snowflakes that comes one after another , not just the number of total unique snowflakes. It can be restated as follows: Given a s...

- Sat Feb 21, 2009 12:32 pm
- Forum: Other words
- Topic: SPOJ BRCKTS Using segment tree (help!)
- Replies:
**0** - Views:
**3671**

### SPOJ BRCKTS Using segment tree (help!)

I was working on https://www.spoj.pl/problems/BRCKTS/ My half solution : Replace all the '(' with 1 and ')' with -1 and construct a new array A[ ]. ( A = 1 or -1 ) calculate C[ ]. ( C is the sum of the values A[0]...A ) Now, for determining whether the word is correct or not you need to check if A[ ...

- Sat Feb 14, 2009 7:38 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10589 - Area
- Replies:
**48** - Views:
**18432**

### Re: 10589 - Area

You don't need to use this complex and error prone

The very straightforward approach using

**long long**method any more...The very straightforward approach using

**doubles**is enough to get AC. I think the judge data is ok now- Sat Feb 14, 2009 6:40 pm
- Forum: Volume 4 (400-499)
- Topic: 498 - Polly the Polynomial
- Replies:
**73** - Views:
**13946**

### Re: 498 TLE

I made the following change in your second

good luck!

**while**loop and got AC:Code: Select all

```
while(1)
{
int ret = scanf("%d%c",&c[i++],&a);
if(ret != 2) return 0;
if(a==10)break;
}
```

- Sat Feb 14, 2009 5:53 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10183 - How Many Fibs?
- Replies:
**66** - Views:
**24070**

### Re: 10183 - How many Fibs?

for the input:
your program returns 4. when the correct answer should be 2.

Code: Select all

```
0 2
0 0
```

- Tue Sep 09, 2008 7:39 am
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies:
**196** - Views:
**29541**

### Re: 371 - Ackermann Functions #TLE. Please Help!

try to do some memoization.

Don't calculate for the same input again, just save the cycle length in an array...

Don't calculate for the same input again, just save the cycle length in an array...

- Tue Sep 09, 2008 7:32 am
- Forum: Volume 100 (10000-10099)
- Topic: 10006 - Carmichael Numbers
- Replies:
**66** - Views:
**21066**

### Re: 10006 - Carmichael Numbers

reply for adhoc17...... Your program returns 62 Carmichael Numbers in the input range, while there are only 15 for example 341,645,....60787 are not a Carmichael Numbers, but your program says they are also Carmichael numbers your isprime() function does not work for numbers which are a power of two...

- Tue Sep 09, 2008 6:41 am
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies:
**270** - Views:
**32389**

### Re: 488wa!!!!!!!please help me!!!!!!!!where is the problem

You must print blank lines between testcases also....

read the problem statement again carefully.....

read the problem statement again carefully.....

- Mon Sep 08, 2008 7:17 pm
- Forum: Off topic (General chit-chat)
- Topic: What kinds of problems do you solve most ?
- Replies:
**25** - Views:
**76950**

### Re: What kinds of problems do you solve most ?

I love solving any kind of problems. But specially I like,

1. number theoritic problems

2. bfs, dfs related graph problems

3. any problem that has a recursive solution.

1. number theoritic problems

2. bfs, dfs related graph problems

3. any problem that has a recursive solution.