May be you don't like backtracking or you are very good in DP. But your statement is not correct. I got ACCEPTED using backtrack and it took .008 sec.CodeMaker wrote:This is a DP (Dynamic Programming) problem. Backtrack will give u nothing but TLE.
Search found 17 matches
- Fri Dec 01, 2006 2:38 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10364 - Square
- Replies: 47
- Views: 22076
- Sat Oct 14, 2006 1:19 am
- Forum: Volume 103 (10300-10399)
- Topic: 10336 - Rank the Languages
- Replies: 21
- Views: 13918
- Tue Oct 10, 2006 9:23 am
- Forum: Volume 101 (10100-10199)
- Topic: 10139 - Factovisors
- Replies: 80
- Views: 42031
- Wed Oct 04, 2006 9:08 pm
- Forum: Volume 3 (300-399)
- Topic: 333 - Recognizing Good ISBNs
- Replies: 166
- Views: 40692
Re: 333 - PE - but why?
Here's my code that gives presentation error with oj.... is it because of the endl on seeing eof??
I think you have printed the trailing spaces of the input string and getting PE.
In general,the leading and trailing spaces must be deleted when print the input string as output.
Warning: No,spaces ...
I think you have printed the trailing spaces of the input string and getting PE.
In general,the leading and trailing spaces must be deleted when print the input string as output.
Warning: No,spaces ...
- Thu Sep 28, 2006 11:13 am
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
Help me
I got 3 seconds with read(0, buf, 1024*1024) and a linear-time algorithm. It also helps not to store the numbers that you read. Read them one at a time and throw them away immediately.
Can anyone send the code segment where this read() function has been used and the data has been processed ...
Can anyone send the code segment where this read() function has been used and the data has been processed ...
- Tue Sep 19, 2006 10:16 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
- Sun Sep 17, 2006 9:51 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
- Sun Sep 17, 2006 9:16 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10990 - Another New Function
- Replies: 32
- Views: 18722
Use backtracking to generate all unique prime factorization
got AC in 1.822. how to reduce it?
i did:
modified sieve ran upto 2000000
then recursion to get depth[]
then O(1) output
Mahbub
I have generated all prime factorization and generated value for the phi(n) at the same time.
You can get the prime factorization and number of relative primes of ...
i did:
modified sieve ran upto 2000000
then recursion to get depth[]
then O(1) output
Mahbub
I have generated all prime factorization and generated value for the phi(n) at the same time.
You can get the prime factorization and number of relative primes of ...
- Sat Sep 16, 2006 10:38 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
- Fri Sep 15, 2006 12:26 am
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
- Fri Sep 15, 2006 12:03 am
- Forum: Volume 110 (11000-11099)
- Topic: 11086 - Composite Prime
- Replies: 33
- Views: 23509
Re: I rather thank the problem setter.
If the problem is simple & specific, then where is our challenges?
So, you think a problem which is !(specific & simple),that is challenging?
!(specific & simple) = (!specific) || (!simple)
Ok, i am giving you a simple and (!specific) problem-
#Find A+B where A>10 && B>10 (It's not typing ...
So, you think a problem which is !(specific & simple),that is challenging?
!(specific & simple) = (!specific) || (!simple)
Ok, i am giving you a simple and (!specific) problem-
#Find A+B where A>10 && B>10 (It's not typing ...
- Sun Sep 10, 2006 8:01 am
- Forum: Volume 110 (11000-11099)
- Topic: 11087 - Divisibility Testing
- Replies: 36
- Views: 21993
- Sun Sep 10, 2006 7:41 am
- Forum: Volume 110 (11000-11099)
- Topic: 11086 - Composite Prime
- Replies: 33
- Views: 23509
11086 - Composite Prime
After long time i got a number theory problem with such an undefined statement like "N integers are positive-natural numbers". What does natural number means? Shall we try upto INFINITY?? Would you please tell me what would be the trouble if you had specified it with specific number. By the way i ...
- Thu Aug 31, 2006 7:22 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10129 - Play on Words
- Replies: 34
- Views: 13690
Re: 10129 ( plz give me some critical i\o)
Try This:tuman wrote:I badly need some input-output for the problem PLAY on WORDS its a simple Euler path problem but i cant do anything unless i experience some critical input and output.
![]()
![]()
![]()
![]()
Input:
2
4
ad
da
pq
qp
4
ad
da
ad
da
Output:
The door cannot be opened.
Ordering is possible.
- Tue Aug 15, 2006 8:31 am
- Forum: Volume 110 (11000-11099)
- Topic: 11073 - Euler's Totient Function
- Replies: 20
- Views: 8718
Take it easy
can someone post the paper that is to be read or how should one go about solving this problem. i have tried it but am out of ideas. All i know i could find from observations is that the odd solutions lie between n+1 and 4*n (maybe wrong). But for 10^9 it is too long.
I didn't considered any ...
I didn't considered any ...