## Search found 72 matches

Tue Nov 02, 2010 11:34 am
Forum: Volume 118 (11800-11899)
Topic: 11863 - Prime Game
Replies: 1
Views: 2099

### 11863 - Prime Game

WoW.
Great.......
No need to think pass.
Just ignore 'K' or put K=0 always.

"Soha" && "Tara"
Tue Oct 26, 2010 6:20 pm
Forum: Volume 118 (11800-11899)
Topic: 11828 - Palindrome Again
Replies: 6
Views: 2384

### Re: 11828 - Palindrome Again

I am not able to figure it out your DP.

Code: Select all

``for(i=0...i<=k , j=k-i ) result+=DP1[i][MM] + DP2[j][M] ;``
you can simply discover that result must be
result+=DP1[MM] * DP2[j][M] ;

At first define DP1 and DP2 carefully.
Mon Oct 25, 2010 3:38 pm
Forum: Volume 118 (11800-11899)
Topic: 11828 - Palindrome Again
Replies: 6
Views: 2384

### Re: 11828 - Palindrome Again

I solved it with O(Testcase*K+N*K). I got idea from my Academic elder brother (Jane Alam Jan). "Thanks Jan vai" let n be length, A[0 to (n-1)] P= number of characters where a = a[n-i-1]; Q= number of characters where a != a[n-i-1]; Then Independently calculate DP(P,K); and DP2(Q,K); Hope you have go...
Mon Oct 18, 2010 7:19 pm
Forum: Volume 118 (11800-11899)
Topic: 11828 - Palindrome Again
Replies: 6
Views: 2384

### Re: 11828 - Palindrome Again

My solution 500*1000 for each case.
But still TLE.
No Of test case 5000. (huge).
Is it needed to solve in linear time?
Tue Jun 29, 2010 9:47 pm
Forum: Volume 117 (11700-11799)
Topic: 11735 - Corner the Queens
Replies: 3
Views: 2659

### Re: 11735 - Corner the Queens

Thanks Jan vai.
Your's one was 2 times faster than me.
I found that my code calls a binary search function 16 times for each case.
Tue Jun 29, 2010 9:40 pm
Forum: Volume 117 (11700-11799)
Topic: 11708 - Lexicographical ranking
Replies: 2
Views: 2423

### Re: 11708 -- Lex Ranking

@serur
Try these:
Input:

Code: Select all

``````zpk
1
2
2
4
5
6
7
8
9
10
11
12
13
14
15
zsrqponmlkjihgfedcya
21
1
6613313319248080000
6613313319248070040
``````
AC output:

Code: Select all

``````15
k
kp
kp
kz
kzp
p
pk
pkz
pz
pzk
z
zk
zkp
zp
zpk
6594882320481860667
acdefghijklmnopqrsz
a
zysrqponmlkjihgfedc
zysrqponmlkjichedaf``````
Hope it will help
Tue Jun 29, 2010 7:48 pm
Forum: Volume 117 (11700-11799)
Topic: 11797 - Drutojan Express
Replies: 14
Views: 4827

### Re: 11797-WA!

OMG...i forgot to reinitialize my cost array... :roll: Thnx a lot for finding out such a foolish mistake. :D :lol: (i've edited the code above) But the problem still continues...Wrong Answer again :( I've read the code again & again but cant find out any other (such foolish :D ) mistake... :( Try t...
Tue Jun 29, 2010 3:27 pm
Forum: Volume 117 (11700-11799)
Topic: 11725 - Colorful Board
Replies: 3
Views: 2386

### Re: 11725-Colorful Board

@Jan vai:
There have some forbidden cells. So I did DP using row Masking Idea.
would you illustrate your Idea briefly?
Tue Jun 29, 2010 9:43 am
Forum: Volume 117 (11700-11799)
Topic: 11797 - Drutojan Express
Replies: 14
Views: 4827

### Re: 11797-WA!

@Sachin Actually I tried to figure out the Runtime error ignoring the wrong answer. Anyway try below multiple cases input: 2 3 11 Ja 5 Tan Sid Sam Sha Tan 1 Ja 1 Ja 1 Ja 1 Ja 3 11 Ja 5 Tan Sid Sam Sha Tan 1 Ja 1 Ja 1 Ja 1 Ja Compare two output and think how big mistake you have done. :D
Mon Jun 28, 2010 2:14 pm
Forum: Volume 117 (11700-11799)
Topic: 11797 - Drutojan Express
Replies: 14
Views: 4827

### Re: 11797-WA!

for(i=0;i<k[mymap[name]]-1;i++) ar[mymap[name]] =ar[mymap[name]][i+1]; ar[mymap[name]][i+1]=save; Check these above lines carefully. when k[mymap[name]]==20, After the loop i will be 19. Then "ar[mymap[name]][ 19+1 ]=save;" which is wrong And also it will create RE . Because ar[5][20] allow ar[0-4]...
Mon Jun 28, 2010 1:22 pm
Forum: Volume 117 (11700-11799)
Topic: 11779 - Lost File
Replies: 3
Views: 2544

### Re: 11779 - Lost File

Fri Jun 25, 2010 1:38 pm
Forum: Volume 117 (11700-11799)
Topic: 11779 - Lost File
Replies: 3
Views: 2544

### 11779 - Lost File

Using cin I got TLE(3s).
After using Scanf It AC in 0.348s.
Thu Jun 24, 2010 3:17 pm
Forum: Volume 117 (11700-11799)
Topic: 11725 - Colorful Board
Replies: 3
Views: 2386

### 11725 - Colorful Board

Some one please share Idea for this problem.
I solved it but timing(0.504s) was so much poor.

Thu Jun 24, 2010 10:12 am
Forum: Volume 117 (11700-11799)
Topic: 11735 - Corner the Queens
Replies: 3
Views: 2659

### 11735 - Corner the Queens

At first I read the link: http://sps.nus.edu.sg/~limchuwe/cgt/cgt1.htm Then I calculated all losing position. Then for every test case I need O( 2*log2(690000) ) Iterations.(twice binary search) But Time limit 1.000 second. Have any constant solution ?? My AC time: 0.112s some Intput/output: 10 41 4...
Wed Jun 23, 2010 6:10 pm
Forum: Volume 117 (11700-11799)
Topic: 11730 - Number Transformation
Replies: 7
Views: 3959

### Re: 11730 - Number Transformation

Input:

Code: Select all

``````7 14
11 33
2 2
3 4
4 3
0 0
``````
AC output:

Code: Select all

``````Case 1: -1
Case 2: -1
Case 3: 0
Case 4: -1
Case 5: -1
``````