Search found 29 matches

by crip121
Tue Aug 09, 2011 6:48 am
Forum: Volume 120 (12000-12099)
Topic: 12032 - The Monkey and the Oiled Bamboo
Replies: 23
Views: 6736

Re: 12032

oh.. im sorry.. here's the input i intended to post

Code: Select all

1
4
3 5 7 9
correct answer would be 4. but your code gives 3.
by crip121
Mon Aug 08, 2011 3:59 pm
Forum: Volume 120 (12000-12099)
Topic: 12032 - The Monkey and the Oiled Bamboo
Replies: 23
Views: 6736

Re: 12032

naseef, check your output for following input.

Code: Select all

1
3
3 2 2
by crip121
Mon Jun 13, 2011 2:06 pm
Forum: Volume 116 (11600-11699)
Topic: 11651 - Krypton Number System
Replies: 5
Views: 2994

Re: 11651

hmm.. i reduced my matrix multiplication part from 2*n^3 to n^3.. and now getting WA :(
im doing all calculation on unsigned long without any mod operation and its giving me right answer in my compiler.. is it wrong ? should i use mod operation ? :-?
by crip121
Mon Jun 13, 2011 2:04 am
Forum: Volume 116 (11600-11699)
Topic: 11651 - Krypton Number System
Replies: 5
Views: 2994

Re: 11651

im using matrix expo but it seems to be slow on input sets algo: expo( p ) { if( p==1 ) return base else { a = expo(p/2); b = a*a; if(p%2==1) a = a*base return a; } so, for odd values of "p" im doing 2 matrix multiplication. so my algorithms complexity is actually 2*3^n*log(p). any idea how to reduc...
by crip121
Sun Mar 27, 2011 1:38 pm
Forum: Volume 101 (10100-10199)
Topic: 10157 - Expressions
Replies: 23
Views: 12051

Re: 10157 - Expressions

Code: Select all

32767
5828185
8558854
2937932
404984
22536
403
1
0
0
0
by crip121
Thu Feb 10, 2011 1:51 pm
Forum: Volume 119 (11900-11999)
Topic: 11908 - Skyscraper
Replies: 6
Views: 2060

Re: 11908 - Skyscrapper

after reading taman's post, i looked at my code again and cant decide whether it would be dp or greedy. but i think its a close resembelance to LIS algorithm with a bit of greedy choice. sorry if it makes anyone misguided. :( here's my algo, 1. sort (criteria is yours to decide) 2. now, for i'th pos...
by crip121
Sun Feb 06, 2011 3:28 pm
Forum: Volume 119 (11900-11999)
Topic: 11908 - Skyscraper
Replies: 6
Views: 2060

Re: 11908 - Skyscrapper

greedy will do..
by crip121
Thu Jan 20, 2011 4:19 pm
Forum: Volume 119 (11900-11999)
Topic: 11904 - One Unit Machine
Replies: 3
Views: 2443

11904 - One Unit Machine

can anyone give me any hint. :-?
by crip121
Tue Jan 11, 2011 11:29 pm
Forum: Volume 119 (11900-11999)
Topic: 11902 - Dominator
Replies: 20
Views: 9035

Re: 11902 - dominator

@tanmoy, i think all of the graph in your i/o is not DAG. but strangly, in problem statement, 2nd graph contains a self loop. although i treated given graph as a DAG and got AC.
by crip121
Sat Dec 25, 2010 8:03 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 31829

Re: 10032 - Tug of War

there's an easy problem which is quite similar with this one, 562 : dividing coins.
by crip121
Sun Nov 28, 2010 9:59 pm
Forum: Volume 100 (10000-10099)
Topic: 10096 - The Richest Man of the Universe
Replies: 42
Views: 16324

Re: 10096 - Richest Man of the Universe

for PI use this

Code: Select all

#define PI acos(0.0)
and for floating number comparison use

Code: Select all

fabs(a-b)<=0.000000001
by crip121
Thu Oct 14, 2010 12:38 am
Forum: Volume 100 (10000-10099)
Topic: 10086 - Test the Rods
Replies: 10
Views: 4501

Re: 10086 - Test the Rods

its a DP problem...
by crip121
Sat Mar 13, 2010 7:20 pm
Forum: Volume 101 (10100-10199)
Topic: 10123 - No Tipping
Replies: 2
Views: 2185

Re: 10123 - No Tipping

sometime wrote:Have your 10123 - No Tipping Accepted? My code is Time Limit Exceeded.
Could you help me? Thank you.
anyone help me?? thank you very much~~~
i used memoization to solve this task. think abt it. if u hav trouble then PM me :D
by crip121
Sat Mar 06, 2010 6:31 pm
Forum: Volume 102 (10200-10299)
Topic: 10275 - Guess the Number!
Replies: 4
Views: 2879

Re: 10275 - Guess the Number!

i am unsuccessfully trying to solve this problem.... here's my algo 1. generate digit[x] -> number of digit(s) in x^x ( using log ) 2. take input and binary search in digit[] to get a approx 3. use fast exponentiation to evaluate x^x 4. check whether calculated x^x is equal as given input string and...
by crip121
Sat Mar 06, 2010 8:44 am
Forum: Volume 102 (10200-10299)
Topic: 10283 - The Kissing Circles
Replies: 13
Views: 5596

Re: 10283 - The Kissing Circles

for input 10000 100, ur output can be different than ACed output posted by red scorpion. i solved this problem using 3 different equation and all of them produced different output for above case but all of those code have gotten AC.

Go to advanced search