Re: [algogeeks] Re: Amazon Dynamic Programming problem

2013-01-12 Thread kumar anurag
yes the below logic is correct
1-> 1st(1)
2-> 1st(2)
3-> 2nd(1,2 or 2,1)
4-> 1st (1,2,1 or 1,1,2)
5->1st(2, 1, 2 or 2, 2, 1)
6-> 2nd(2, 1, 3) or 1, 2,3)) 2nd will win
7-> 1st(1, 1, 2, 3 or 1, 2, 1,3  or .,.
8-> 1st (2, 1, 2, 3 or 2, 2,1, 3 or ..

In above 3 can be (1,2) or (2,1)

Thanks
Kumar Anurag

On Sat, Jan 12, 2013 at 10:11 PM, Lucifer  wrote:

>
> @siva..
>
> if (n%3 == 0)
>   "Player 1 will lose"
> else
>   "Player 1 will win. The no. of balls picked in the first turn will
> be n%3"
>
> --
>
>
>



-- 
Kumar Anurag

-- 




Re: [algogeeks] Adobe written test question

2012-10-24 Thread kumar anurag
in fy2 , the variable arr[10] has not been declared  and hence it should
display error message while compiling

Thanks
Kumar Anurag

On Wed, Oct 24, 2012 at 11:06 PM, rahul sharma wrote:

> int arr[10] // in fyl 1
>
> now in fyl 2
>
> extern int *arr
> void foo()
> {
> arr[0]=10;
> }
> what kind of problem can be there?in what condition and y?
>
> plz comment
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: An interesting question

2011-09-17 Thread kumar anurag
This will work in GCC but not in G++
int main()
{
int new=1;

return 0;
}


There can be many programs of C++ , that cannot be compiled through GCC bcz
C++ is OOP for which G++ is needed.


On Sat, Sep 17, 2011 at 1:50 AM, SAMMM  wrote:

> You can try this also this will work in C++ not in C .
>
> I ) For Register Variable :-
>
> #include
>
> int main()
> {
> register int c=100;
> printf("%u ",&c);
> return 0;
> }
>
>
>
>
> II ) Function inside a structure :-
>
> #include
>
> struct Test
> {
>  char c;
>  void function()
>  {
>printf("hi\n");
>  }
> };
>
> int main()
> {
>  struct Test t;
>  t.function();
>  return 0;
> }
>
>
> ##
>
>
>
> For the opposite Works in C not in C++:-
>
> Compulsory to return an INT in CPP .
>
> #include
>
> main()
> {
>  int c=100;
>  printf("%d \n",c);
>  return ;
> }
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread kumar anurag
can you post the problem link?

On Mon, May 23, 2011 at 7:53 PM, saurabh singh  wrote:

>
> Using the asm construct of c..
> Though i did this problem in native asm and my solution is 3 char ;)...
> The point is you  have to know if not proficient with NASM(Net Assembler
> used by SPOJ)...
> If you need the solution mail me.
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread kumar anurag
can you tell me the problem? or link?

On Mon, May 23, 2011 at 6:09 PM, Dumanshu  wrote:

> In this problem u have to write a code(interested in a C code)  which
> will cause a segmentation fault. Now the trick is to write the code as
> short as possible. Your score is the no. of characters in the code.
> Less the no. of characters, Better the score(rank).
>
> I wrote a code something like this :
>
> main(int*a){*a=3;}
>
> its 18chars.
> But the best solution in C is 5 characters. Does this mean it is
> possible to answer this quesion without using a main() function
> because main() itself is 6 chars?
> Is it possible to compile and run a .c file which doesn't have a
> main() function and cause runtime seg fault?
> Any help would be greatly appreciated.
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Candy_splitting in GCJ

2011-05-11 Thread kumar anurag
sorry, i mean smallest( not sum of smallest, as smallest means a single
element)
2
5 5
101->5
101->5
--
000  -> xor
=0 hence has a solution
so ans=(total sum -smallest)
total sum=5+5=10
smallest=5 -> as minimun(5,5)=5
so ans=(10-5)=5

2nd ex
3 5 6
011->3
101->3
---xor
110
110->6
--xor
000
=0, so has a solution
so ans=(total sum -smallest)
total sum=3+5+6=14
smallest=5 -> as minimun(3,5,6)=3
so ans=(14-3)=11

Is that clear?


On Mon, May 9, 2011 at 12:04 PM, Nikhil Agarwal
wrote:

> @Anurag  What do you mean by sum of smallest...please explain.In
>
> 2
> 5 5
>
> and
>
> 3
> 3 5 6
>
> On Mon, May 9, 2011 at 12:10 AM, kumar anurag 
> wrote:
>
>> find xor of all elements - if its equal to zeo then Case has solution
>> otherwise NO
>> for finding the soltuion just sort all the elements and find the (sum of
>> all -sum of smallest)..
>>
>>
>>
>> On Sun, May 8, 2011 at 9:50 PM, Kunal Patil  wrote:
>>
>>> Can anybody tell me How to solve candy splitting problem appeared in
>>> Google Code Jam Qualification round?
>>> I know there is solution, if XOR of all elements comes to be zero.
>>> But i wasn't able to proceed from there as I couldn't think of way how to
>>> partition that elements.
>>> (I have read solutions from other contestants but as expected they are
>>> dirty for the one who doesn't know logic behind program)
>>> So plz help...
>>>
>>> --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Kumar Anurag
>>
>>  --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Thanks & Regards
> Nikhil Agarwal
> B.Tech. in Computer Science & Engineering
> National Institute Of Technology, Durgapur,India
> http://tech-nikk.blogspot.com
> http://beta.freshersworld.com/communities/nitd
>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Candy_splitting in GCJ

2011-05-09 Thread kumar anurag
GoroSort , i think was tougher, after seeing the number of people solved , i
even didi not read the problem statement...

Woking code for Candy Splitting is below, u can check it for both Small and
Large tests, it passes all

--
#include 
#include
#include
#include
#include
#include
using namespace std;

int main()
{
FILE *p=fopen("input.in","r");
FILE *p2=fopen("output.txt","w");

int cases;
//cin>>cases;
fscanf(p,"%d",&cases);
int cs=0;
while(cases--)
{

  //cin>>N;
  int N;
  fscanf(p,"%d",&N);

  int total_sum=0,xors=0;
  int array[N+1];
 //main work starts here...
      for(int i=0;i wrote:

> And the last one, GoroSort?
>
>
> 2011/5/9 kumar anurag 
>
>> find xor of all elements - if its equal to zeo then Case has solution
>> otherwise NO
>> for finding the soltuion just sort all the elements and find the (sum of
>> all -sum of smallest)..
>>
>>
>>
>> On Sun, May 8, 2011 at 9:50 PM, Kunal Patil  wrote:
>>
>>> Can anybody tell me How to solve candy splitting problem appeared in
>>> Google Code Jam Qualification round?
>>> I know there is solution, if XOR of all elements comes to be zero.
>>> But i wasn't able to proceed from there as I couldn't think of way how to
>>> partition that elements.
>>> (I have read solutions from other contestants but as expected they are
>>> dirty for the one who doesn't know logic behind program)
>>> So plz help...
>>>
>>> --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Kumar Anurag
>>
>>  --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Candy_splitting in GCJ

2011-05-08 Thread kumar anurag
find xor of all elements - if its equal to zeo then Case has solution
otherwise NO
for finding the soltuion just sort all the elements and find the (sum of all
-sum of smallest)..


On Sun, May 8, 2011 at 9:50 PM, Kunal Patil  wrote:

> Can anybody tell me How to solve candy splitting problem appeared in Google
> Code Jam Qualification round?
> I know there is solution, if XOR of all elements comes to be zero.
> But i wasn't able to proceed from there as I couldn't think of way how to
> partition that elements.
> (I have read solutions from other contestants but as expected they are
> dirty for the one who doesn't know logic behind program)
> So plz help...
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] [brain teaser ] 25march

2011-03-25 Thread kumar anurag
Divide the balls in 3 groups with 3 balls each.
if(wightofgrp1==wgthgrp2)
{
  take 3group
  if(wtof 1 ball==wtof2nd ball ) //of 3rd grp)
  {
 then the left one is heavier
 }
 else the one that wighs is hevier
}
else
{
   wight for the heavier group by taking 1st against 2nd
  if(wgtof 1st==wt of 2nd)
 {
   then the left 3rd of the heavier grp is heavy
}
 else the one that is heavier in pan is heavier..
}

thats alll...take 2 times to get the result

On Fri, Mar 25, 2011 at 1:16 PM, Lavesh Rawat wrote:

>
>
> *Weighing Problem Solution*
> *
> *There are 9 similar balls. Eight of them weigh the same and the ninth is
> a bit heavier.
> How would you identify the heavier ball if you could use a two-pan balance
> scale only twice?
>
> Update Your Answers at : Click 
> Here<http://dailybrainteaser.blogspot.com/2011/03/25march.html?lavesh=lavesh>
>
> Solution:
> Will be updated after 1 day
>
>
> Soln
>
>
> --
> Posted By lavesh to brain teaser 
> solutions<http://solution-dailybrainteaser.blogspot.com/2011/03/25march.html>at
>  3/25/2011 12:01:00 AM
>
>
>
> --
>
> "Never explain yourself. Your friends don’t need it and
> your enemies won’t believe it" .
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: power of 2

2011-03-20 Thread kumar anurag
use a precomputed table
On Sun, Mar 20, 2011 at 2:38 PM, cegprakash  wrote:

> i'm asking in java bigintegers
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: power of 2

2011-03-20 Thread kumar anurag
try to find the MSB position of the binary form of number. Then position+1
should be the answer

On Sun, Mar 20, 2011 at 2:27 PM, kumar anurag wrote:

> in gcc it is found in math.h
>
>
> On Sun, Mar 20, 2011 at 2:16 PM, cegprakash  wrote:
>
>> how to find log2(a)  in c++?
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Kumar Anurag
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: power of 2

2011-03-20 Thread kumar anurag
in gcc it is found in math.h

On Sun, Mar 20, 2011 at 2:16 PM, cegprakash  wrote:

> how to find log2(a)  in c++?
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] How to print numbers from 1 to 100 without loop , without recursion , without #define statements , without goto statement

2011-03-16 Thread kumar anurag
ok guys...

On Wed, Mar 16, 2011 at 9:54 PM, himanshu kansal <
himanshukansal...@gmail.com> wrote:

>
> class arr
> {static int i;
> public:
> arr()
> {
> cout< }
> };
> int arr::i=1;
>
> int main()
> {
> arr a[100];
>
> }
> On Wed, Mar 16, 2011 at 9:47 PM, kumar anurag 
> wrote:
>
>>
>> using two different functions calling one another ?
>>
>> like
>> fun1()
>> {
>>   fun2()
>> }
>> fun2()
>> {
>>   fun1();
>>
>> }
>>
>>
>> On Wed, Mar 16, 2011 at 9:39 PM, D.N.Vishwakarma@IITR 
>> wrote:
>>
>>> *
>>> *
>>> --
>>> *With Regards
>>> Deoki Nandan Vishwakarma
>>> IITR MCA
>>> Mathematics Department
>>> *
>>>
>>>  --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Kumar Anurag
>>
>>  --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Print Hello

2011-03-16 Thread kumar anurag
@anurag good.
On Wed, Mar 16, 2011 at 9:28 PM, Anurag atri wrote:

> #include
> using namespace std ;
> class a
> {
> public :
> a() { cout<<"hello";}
> }a1;
> int main()
> {
> }
>
> On Wed, Mar 16, 2011 at 8:25 PM, himanshu kansal <
> himanshukansal...@gmail.com> wrote:
>
>> How can u print "hello" in a c/c++ program without writing a single
>> word in main() function
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Regards
> Anurag Atri
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] How to print numbers from 1 to 100 without loop , without recursion , without #define statements , without goto statement

2011-03-16 Thread kumar anurag
using two different functions calling one another ?

like
fun1()
{
  fun2()
}
fun2()
{
  fun1();
}


On Wed, Mar 16, 2011 at 9:39 PM, D.N.Vishwakarma@IITR wrote:

> *
> *
> --
> *With Regards
> Deoki Nandan Vishwakarma
> IITR MCA
> Mathematics Department
> *
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Brainfuck compiler

2011-03-15 Thread kumar anurag
the code is attached , u can covert bf program to c , more info is in the
file

On Wed, Mar 16, 2011 at 12:43 AM, Saikat Debnath wrote:

> @ kumar anurag : Can you please upload the code...
>
>
> On Wed, Mar 16, 2011 at 12:35 AM, Carl Barton 
> wrote:
>
>> Ahhh I see. Thanks
>>
>>
>> On 15 March 2011 16:11, Ankur Khurana  wrote:
>>
>>> @carl : may be this : https://www.spoj.pl/problems/SBSTR1/
>>>
>>>
>>> On Tue, Mar 15, 2011 at 9:35 PM, kumar anurag >> > wrote:
>>>
>>>> I used a prgram of c which converts brainfuck program to C progaram
>>>> which u can compile using gcc
>>>>
>>>>
>>>> On Tue, Mar 15, 2011 at 9:12 PM, Carl Barton <
>>>> odysseus.ulys...@gmail.com> wrote:
>>>>
>>>>> Just out of interest. What are you planning to write in brainfuck?
>>>>>
>>>>>
>>>>> On 15 March 2011 14:58, Natansh Verma  wrote:
>>>>>
>>>>>> I don't know about Windows 7, but there is an interpreter online, in
>>>>>> case you want one.
>>>>>>
>>>>>> http://brainfuck.tk/
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 15, 2011 at 5:15 PM, cegprakash wrote:
>>>>>>
>>>>>>> do anyone knows a brainfuck compiler for windows 7? I need a link to
>>>>>>> download it.
>>>>>>>
>>>>>>> I'm new to this group.
>>>>>>> Hope you guyz will help.
>>>>>>>
>>>>>>> --
>>>>>>> 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 options, visit this group at
>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>
>>>>>>>
>>>>>>  --
>>>>>> 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 options, visit this group at
>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>
>>>>>
>>>>>  --
>>>>> 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 options, visit this group at
>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kumar Anurag
>>>>
>>>> --
>>>> 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 options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>  --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 

Re: [algogeeks] Brainfuck compiler

2011-03-15 Thread kumar anurag
I used a prgram of c which converts brainfuck program to C progaram which u
can compile using gcc

On Tue, Mar 15, 2011 at 9:12 PM, Carl Barton wrote:

> Just out of interest. What are you planning to write in brainfuck?
>
>
> On 15 March 2011 14:58, Natansh Verma  wrote:
>
>> I don't know about Windows 7, but there is an interpreter online, in case
>> you want one.
>>
>> http://brainfuck.tk/
>>
>>
>> On Tue, Mar 15, 2011 at 5:15 PM, cegprakash  wrote:
>>
>>> do anyone knows a brainfuck compiler for windows 7? I need a link to
>>> download it.
>>>
>>> I'm new to this group.
>>> Hope you guyz will help.
>>>
>>> --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> 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 options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] spoj problem

2011-03-12 Thread kumar anurag
which probem ? pls gve the link
On Sat, Mar 12, 2011 at 8:27 PM, Akshata Sharma
wrote:

> yeah I too got AC. The way I was calculating gcd was not efficient. :)
>
> On 3/12/11, Logic King  wrote:
> > Here is my solution.i got it AC
> >
> > #include
> > int gcd(int a, int b)
> > {   int temp;
> >while(b)
> >{
> >temp = a % b;
> >a = b;
> >b = temp;
> >}
> > return(a);
> > }
> >
> > int main()
> > {
> >int n,i,min,ans=0;
> >scanf("%d",&n);
> >int arr[n],ard[n];
> >ard[0]=1;
> >if(n>0)
> >scanf("%d",&arr[0]);
> >for(i=1;i >{
> >scanf("%d",&arr[i]);
> >ard[i]=arr[i]-arr[i-1];
> >if(i==1)
> >min=ard[i];
> >else
> >min=gcd(min,ard[i]);
> >
> >}
> >for(i=1;i >{
> >ans+=((ard[i]/min)-1);
> >}
> >printf("%d",ans);
> > return 0;
> > }
> >
> >
> >
> > On Sat, Mar 12, 2011 at 7:37 PM, Balaji Ramani
> > wrote:
> >
> >> Yeah, I too am wondering how to implement more efficiently.
> >>
> >>
> >> On Sat, Mar 12, 2011 at 7:36 PM, Satyam Kapoor
> >> wrote:
> >>
> >>>
> >>>
> >>> @balaji:i hve got ac with gcd method but the time is 0.32 sec
> >>>  best soln is 0.03
> >>> how is that achievable?
> >>> --
> >>> Satyam Kapoor
> >>> B.Tech 2nd year
> >>> Computer Science And Engineering
> >>> M.N.N.I.T ALLAHABAD
> >>>
> >>>  --
> >>> 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 options, visit this group at
> >>> http://groups.google.com/group/algogeeks?hl=en.
> >>>
> >>
> >>  --
> >> 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 options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >>
> >
> > --
> > 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 options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.