Yes.
Since in your program u are not precomputing all the prime numbers before taking the input which increases your time a lot.
Search found 74 matches
- Mon Apr 13, 2009 7:43 am
- Forum: Volume 8 (800-899)
- Topic: 884 - Factorial Factors
- Replies: 49
- Views: 28495
- Sun Apr 12, 2009 5:44 pm
- Forum: Volume 8 (800-899)
- Topic: 884 - Factorial Factors
- Replies: 49
- Views: 28495
Re: 884 - Factorial Factors
use sieve and try to compute everything within the sieve function.
- Sun Apr 12, 2009 2:36 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11404 - Palindromic Subsequence
- Replies: 25
- Views: 14732
Re: 11404 - Palindromic Subsequence
Can someone please reply.
- Sun Apr 12, 2009 12:44 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11604 - General Sultan
- Replies: 7
- Views: 1824
Re: 11604 General Sultan
Try the following input
Input
Output
Input
Code: Select all
4
a 1
b 110
c 11
d 10
0
Code: Select all
Case #1: Ambiguous.
- Sun Apr 12, 2009 11:36 am
- Forum: Volume 116 (11600-11699)
- Topic: 11602 - SMS for Blind
- Replies: 3
- Views: 1270
11602 - SMS for Blind
Can someone please help me how to proceed with this problem.
Thanx in advance
Thanx in advance
- Sun Apr 12, 2009 10:59 am
- Forum: Volume 116 (11600-11699)
- Topic: 11604 - General Sultan
- Replies: 7
- Views: 1824
Re: 11604 General Sultan
Consider the case 1+110 == 11 + 10.
The output for the above case should be ambiguous.
Hope it helps.
The output for the above case should be ambiguous.
Hope it helps.
- Sat Apr 11, 2009 9:31 am
- Forum: Volume 114 (11400-11499)
- Topic: 11404 - Palindromic Subsequence
- Replies: 25
- Views: 14732
Re: 11404 - Palindromic Subsequence
Now I have recoded it again to get a WA. I pass all the inputs in this forum. can someone please help me. :cry: :cry: :cry: #include<iostream> #include<vector> using namespace std; char ss[1008],ch[1008][1008]; int len[1008][1008],pos[1008][1008],fw[1008],re[1008],st,en; bool vis[1001][1001]; int re...
- Sun Apr 05, 2009 4:53 am
- Forum: Volume 115 (11500-11599)
- Topic: 11583 - Alien DNA
- Replies: 5
- Views: 1423
Re: 11583 - Alien DNA
Thanx a lot 4 u reply. It was very helpful for me. I finally managed to solve it.
- Sat Apr 04, 2009 11:30 am
- Forum: Volume 115 (11500-11599)
- Topic: 11583 - Alien DNA
- Replies: 5
- Views: 1423
Re: 11583 - Alien DNA
I am unable to understand this problem. Can someone please explain it to me??
Than in advance
Than in advance
- Sat Apr 04, 2009 10:07 am
- Forum: Volume 115 (11500-11599)
- Topic: 11539 - Another Word Game
- Replies: 6
- Views: 2973
Re: 11539 - Another new game
Can someone please help me on how to reduce the time on this question. I am getting TLE. I used tries for looking up the dictionary and also use memorization for storing the maximum value between any 2 indices once its computed. Any help is appreciated. Thanx in advance. #include <iostream> #define ...
- Fri Mar 13, 2009 7:00 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10054 - The Necklace
- Replies: 62
- Views: 33107
Re: 10054 - The Necklace
Your program gives wrong answer for the input
Code: Select all
1
4
1 2
2 2
2 1
1 1
- Wed Mar 11, 2009 8:50 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 33686
Re: 371 - Ackermann Functions #TLE. Please Help!
this one is same as the 3n+1 problem memorization can be done by the following way:- Suppose u are calculating the cycle length of a number 'a' and during this u arrive to an intermediate value b whose cycle length had been found initially den just add the the cycle length of b to the current length...
- Wed Mar 11, 2009 2:42 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11585 - Nurikabe
- Replies: 20
- Views: 7693
Re: 11585 - Nurikabe
I am still not able to get an Acc for this problem. Can someone plz help me by posting some test i/o.
Thnx
Thnx
- Tue Mar 10, 2009 6:42 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11585 - Nurikabe
- Replies: 20
- Views: 7693
Re: 11585 - Nurikabe
Hi vahid,
Can u tell him how did u incorporate such a thing in ur code in which the number of dots given in the description is less then the actual dots present in the nurikabe??
waiting for ur reply
Can u tell him how did u incorporate such a thing in ur code in which the number of dots given in the description is less then the actual dots present in the nurikabe??
waiting for ur reply

- Tue Mar 10, 2009 12:59 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11585 - Nurikabe
- Replies: 20
- Views: 7693
Re: 11585 - Nurikabe
I have a doubt. Can thr be such type of input :-
the description tells that there are only 2 dots but there are 4 in the actual nurikabe.
If yes what should be the answer
Code: Select all
1
3 4 2
0 3 1
1 1 1
###.
#.##
.##.
If yes what should be the answer