@gene: can u give the function for unfair_coin_toss so that i can
understand what u are doing in fair_coin_toss
On Mar 19, 9:54 am, Gene wrote:
> On Friday, March 18, 2011 1:47:45 PM UTC-4, Gene wrote:
>
> > On Mar 17, 10:24 am, saurabh agrawal wrote:
> > > Given a function which returns true 6
could someone plz help me with a pdf for learning segment tree? i
don't understand the wiki page
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
could someone plz help me with a pdf for learning segment tree? i
don't understand the wiki page
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
why not use the criba of Eratóstenes?
On 18 mar, 11:41, samby wrote:
> The problem goes like this :
> Peter wants to generate some prime numbers. Your task is to generate
> all prime numbers between two given numbers!
>
> Input
> The input begins with the number t of test cases in a single line
>
@karans..dude..dude..dude..
1st thing dat..a s/w engg. can't live without copy & paste..every1
does the samething so nothing new in this. .
2nd is that..whatever one is doing it should help others & understood-
able..
okkk..karan..:lol
well i don't like spamming but m j
Here is my code for TRICOUNT problem
//http://www.spoj.pl/problems/TRICOUNT/
//cegprak...@gmail.com
#include
#include
using namespace std;
unsigned long long start,end,arr[101],arr2[101];
//number of triangles facing upwards=arr
//number of triangles facing downwards=arr2
int main(){
do anyone got this pattern?
On Mar 17, 6:16 pm, rohit wrote:
> 'look and say ' (http://oeis.org/A005150) , begins 1, 11, 21, 1211,
> 111221, 312211, 13112221, 1113213211 ,
> our task is to print this sequence.
> example:
> the sequence is: 1, 11 (or one 1), 21 (two 1's), 1211 (one 2, one 1),
> e
may be u can try to find a more general formula for the series..which just
depends on 'n'...
On Sat, Mar 19, 2011 at 11:48 PM, cegprakash wrote:
> Here is my code for TRICOUNT problem
>
> //http://www.spoj.pl/problems/TRICOUNT/
> //cegprak...@gmail.com
>
> #include
> #include
> using namespace s
i've modified my algorithm
but i'm getting wrong answer. someone help..
#include
using namespace std;
unsigned long long start,end,arr[101],arr2[101];
int main(){
int j,t,i,n;
for(i=0;i<100;i++){
arr[i]=i+1+arr[i-1];
}
for(i=0;i<100;i++)
{
arr[i]+=arr[i-1];
}
arr2[1]=1;
arr2[2]=3;
Yes...
See first num is 1
second is 11 (there is 1 number of 1 in previous number i.e. in 1)
third is 21 (there is 2 number of 1 in previous number i.e. in 11)
fourth is 1211 (there is 1 number of 2 and 1 number of 1 in previous number
i.e. in 21)
ans so on...
Hope u got it
--
You received this m
so the fifth number should be 1231 na??
one 2 and three 1's in 1211
y not?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogee
no .. you see from l to r one 1, one 2 and two 1. now replace one and two
with 1 and 2 respec. :) so its 111221
On Sun, Mar 20, 2011 at 1:36 AM, cegprakash wrote:
> so the fifth number should be 1231 na??
> one 2 and three 1's in 1211
> y not?
>
> --
> You received this message because you are s
can any 1 explain why we have 2 use segment trees ??
I am under the impression that in order to distinguish correct bracket
expressions, we can just count the number of left brackets and compare that
with the number of right brackets, if they are equal then it is a correct
bracket expression.
can
Isn't the number of triangles in level n just n*(n^2 + 6 n - 1)/6?
Dave
On Mar 19, 2:47 pm, cegprakash wrote:
> i've modified my algorithm
> but i'm getting wrong answer. someone help..
>
> #include
> using namespace std;
> unsigned long long start,end,arr[101],arr2[101];
> int main(){
>
hello frnds...
i am getting TLE in 12th test case ..
can anyone over ther help me to shorten it..
#include
#include
using namespace std;
int gcd(int a, int b)
{ if(b==0)
return(a);
else
return gcd(b,a%b);
}
int main()
{
int rec,g,count=0;
scanf("%d",&rec);
for(int i=
how did u arrive at that formula?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more
this formula is giving wrong!!!.. :(
can u pls tell the approach
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubsc
got it!! this just takes an order of number of digits in previous
number. why we need a general term? just precalculate and store in an
array na
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@go
my algo is working fine.. got acc:) :)
small error :P
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@google
Oops. Sorry. The correct formula is n*(n+2)*(2*n+1)/8.
Dave
On Mar 19, 5:26 pm, sunny wrote:
> this formula is giving wrong!!!.. :(
> can u pls tell the approach
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send e
On Saturday, March 19, 2011 6:07:44 AM UTC-4, cegprakash wrote:
>
> @gene: can u give the function for unfair_coin_toss so that i can
> understand what u are doing in fair_coin_toss
>
> On Mar 19, 9:54 am, Gene wrote:
> > On Friday, March 18, 2011 1:47:45 PM UTC-4, Gene wrote:
> >
> > > On Ma
@Krishna
}{
what about this case ?
On Sun, Mar 20, 2011 at 2:11 AM, murthy.krishn...@gmail.com <
murthy.krishn...@gmail.com> wrote:
> can any 1 explain why we have 2 use segment trees ??
>
> I am under the impression that in order to distinguish correct bracket
> expressions, we can just count th
Nopes...why precalculate and waste space...+ It gets bigger n bigger
afterwards
Look at this algorithm..
en.wikipedia.org/wiki/Run-length_encoding
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@
http://www.spoj.pl/forum/viewtopic.php?f=3&t=5240&p=20667&hilit=BRCKTS#p20667
if u know d basics of segment tree..then this thread will help for solving
this prob :)
On Sun, Mar 20, 2011 at 2:11 AM, murthy.krishn...@gmail.com <
murthy.krishn...@gmail.com> wrote:
> can any 1 explain why we have 2
i thot tat i had some mistake in my code and typed it all over again..
finally i noticed this :)
On Sat, Mar 19, 2011 at 12:12 AM, Kunal Patil wrote:
> Hey..
> I also got into same trouble today...
> I submitted it 6 times..then got bored and de moralised cause i cudnt find
> flaw in code...
>
now tell how u arrive at this formula?
On Mar 20, 6:25 am, Dave wrote:
> Oops. Sorry. The correct formula is n*(n+2)*(2*n+1)/8.
>
> Dave
>
> On Mar 19, 5:26 pm, sunny wrote:
>
> > this formula is giving wrong!!!.. :(
> > can u pls tell the approach
--
You received this message because you are
problem ka link bhi diya karo ya code..
On Sun, Mar 20, 2011 at 3:34 AM, sunny wrote:
> hello frnds...
> i am getting TLE in 12th test case ..
> can anyone over ther help me to shorten it..
> #include
> #include
> using namespace std;
> int gcd(int a, int b)
> { if(b==0)
>return
i have given the code in the name of topic!!!
its MRECTCNT
btw
https://www.spoj.pl/problems/MRECTCNT/
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from th
28 matches
Mail list logo