thanx a lot Now it is working for all cases..
On Thu, Jun 9, 2011 at 11:28 AM, varun pahwa varunpahwa2...@gmail.comwrote:
may be now it works for all. please correct me if i am wrong.you haven't
put termination in binary search.
#includeiostream
using namespace std;
void merge(int
did u try it ??
nd did u get the msg??
On Thu, Jun 9, 2011 at 1:06 AM, kartik sachan kartik.sac...@gmail.comwrote:
Frnz govt of india has put a condition dat lokpal bill will b implemented
if 25 crore ppl spport it. plz give a miss kol(free) to 02261550789 .kol
ends itself n u ll get a msg
yup, it works, i tried it!!
On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff ears7...@gmail.comwrote:
did u try it ??
nd did u get the msg??
On Thu, Jun 9, 2011 at 1:06 AM, kartik sachan kartik.sac...@gmail.comwrote:
Frnz govt of india has put a condition dat lokpal bill will b
6
On Wed, Jun 8, 2011 at 10:31 PM, tech rascal techrascal...@gmail.comwrote:
20 ? 150 18 11
--
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,
series of some random numbers generated ussing some RNG
no logic :P :P :P
On Thu, Jun 9, 2011 at 12:29 PM, Arpit Sood soodfi...@gmail.com wrote:
hey,
what's the logic ?
On Thu, Jun 9, 2011 at 12:22 PM, sunny agrawal sunny816.i...@gmail.comwrote:
6
On Wed, Jun 8, 2011 at 10:31
wow it's working ...
On Wed, Jun 8, 2011 at 11:49 PM, sunny agrawal sunny816.i...@gmail.comwrote:
yup, it works, i tried it!!
On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff
ears7...@gmail.comwrote:
did u try it ??
nd did u get the msg??
On Thu, Jun 9, 2011 at
I need some more books specialy on algo ds and puzzles
On Wed, Jun 8, 2011 at 4:07 AM, coder dumca coder.du...@gmail.com wrote:
I am last year student preparing for placements
can any one give some ebooks on data structure, algo etc. like beofre
some time , some one posted a book how to
There is no such condition put up by the govt.
If you give a missed call you are showing your support to Anna Hazare
Please read
http://theindiapost.com/delhi/support-hazare-give-call-02261550789/
On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff ears7...@gmail.comwrote:
did u try it ??
Try placementsindia.blogspot.com , it has a good collection of
problems specific to placements.
On Thu, Jun 9, 2011 at 12:23 PM, coder dumca coder.du...@gmail.com wrote:
I need some more books specialy on algo ds and puzzles
On Wed, Jun 8, 2011 at 4:07 AM, coder dumca coder.du...@gmail.com
hey,
what's the logic ?
On Thu, Jun 9, 2011 at 12:22 PM, sunny agrawal sunny816.i...@gmail.comwrote:
6
On Wed, Jun 8, 2011 at 10:31 PM, tech rascal techrascal...@gmail.comwrote:
20 ? 150 18 11
--
You received this message because you are subscribed to the Google Groups
Algorithm
74658
On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:
*Secret Code puzzle
*
*
*
**
*A man wanted to get into his work building, but he had forgotten his
code. However, he did remember five clues. These are what those clues were:
The fifth number plus the third
7
4
6
5
8
On 9 Jun 2011 13:37, Lavesh Rawat lavesh.ra...@gmail.com wrote:
*Secret Code puzzle
*
*
*
**
*A man wanted to get into his work building, but he had forgotten his code.
However, he did remember five clues. These are what those clues were:
The fifth number plus the third number equals
I would recommend you to read complete Java Reference book by Herbert
Schildt, it will take you nicely through the basics of creating window
based applications. First read the chapters on Applets and AWT and
then you should be able to easily and naturally graduate to using
Swing.
On Thu, Jun 9,
7 4 6 5 8
On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:
*Secret Code puzzle
*
*
*
**
*A man wanted to get into his work building, but he had forgotten his
code. However, he did remember five clues. These are what those clues were:
The fifth number plus the
Sir,
Currently i am not the only one who is having problem with your posts. If
you look at the archives you will see, there are lot of people who consider
you as a spammer. And this group is related to algorithms... this is not a
mailing list for hiring people. Please leave this group, no one
Sir,
Currently i am not the only one who is having problem with your posts. If
you look at the archives you will see, there are lot of people who consider
you as a spammer. And this group is related to algorithms... this is not a
mailing list for hiring people. Please leave this group, no one
Lavesh ,
Sorry it wasn't meant for you. Apologies !
--
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
@naveen Thanks for the prompt reply
I am already aware of Applets and AWT and have started getting acquainted to
Swing
but the problem lies where to start from. Its like I want a small example or
few starting steps.
Complete Reference is the book that i refer.
On Thu, Jun 9, 2011 at 1:48 PM,
As soon as i type Java Swing PDFs in google, i get lots of results.
See if anyone of them can help you.
No tutorial i am having as such specifically for Swing.
On Thu, Jun 9, 2011 at 1:53 PM, snehi jain snehijai...@gmail.com wrote:
@naveen Thanks for the prompt reply
I am already aware of
i Did that before asking for help on the group.
anyways thanks :)
Swing isnt necessary, someone referred so i am trying to learn it.
Any info regarding desktop or phone apps. will be appreciated.
On Thu, Jun 9, 2011 at 2:00 PM, Navneet Gupta navneetn...@gmail.com wrote:
As soon as i type Java
Simple Problem :(
On Thu, Jun 9, 2011 at 1:28 AM, snehi jain snehijai...@gmail.com wrote:
7 4 6 5 8
On Thu, Jun 9, 2011 at 1:48 PM, Naveen Kumar
naveenkumarve...@gmail.comwrote:
7 4 6 5 8
On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:
*Secret Code puzzle
Hi All,
How to implement the regular expressions in C language? I am looking for a
generalized algorithm.
Thanks,
Ravi.
--
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
So i assume your ask is given a string, check if it can be formed with the
regular expression you have. Is that correct?
The above can be implemented easily with stacks.
Ex - Reg Expression - a*bc*
And String - aabccc
Put all instances of char that are consecutive on the stack and then pop the
Hi Moderators,
Can you please Ban Sohail from algogeeks?
We are receiving a lot of spams from him.
sohail.panz...@gmail.com
--
Cheers
Naveen Kumar
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
On Thursday 09 June 2011 03:15 PM, Dumanshu wrote:
Q1. I have a file in which there are supposed to be 4 billion
numbers,
starting from 1 to 4,000,000,000 but unfortunately one number is
missing,
i.e there are only 3,999,999,999 numbers, I need to find the missing
number.
Is the array sorted?
For Q2 Bitwise X-OR operation of all input numbers does the trick.
--- On Thu, 9/6/11, Dumanshu duman...@gmail.com wrote:
From: Dumanshu duman...@gmail.com
Subject: [algogeeks] MS Interview
To: Algorithm Geeks algogeeks@googlegroups.com
Date: Thursday, 9 June, 2011, 9:45 AM
Q1. I have a file
On Thursday 09 June 2011 09:59 AM, Ershad K wrote:
On Thursday 09 June 2011 03:15 PM, Dumanshu wrote:
Q1. I have a file in which there are supposed to be 4 billion
numbers,
starting from 1 to 4,000,000,000 but unfortunately one number is
missing,
i.e there are only 3,999,999,999 numbers, I need
The answer to second question is simple. XORing all the elements
should do it for you.
On Thu, Jun 9, 2011 at 3:15 PM, Dumanshu duman...@gmail.com wrote:
Q1. I have a file in which there are supposed to be 4 billion
numbers,
starting from 1 to 4,000,000,000 but unfortunately one number is
2nd part can be done just take the xor of all the numbers same number xor
returns 0 so only seven will remain.
1st part can be done in O(n) because estimate sum - n*(n+1)/2. now sub from
estimated sum each array element. the last value remained is the missing
number.
correct me if i am wrong.
On
Q1. I have a file in which there are supposed to be 4 billion
numbers,
starting from 1 to 4,000,000,000 but unfortunately one number is
missing,
i.e there are only 3,999,999,999 numbers, I need to find the missing
number.
Q2. I have an array consisting of 2n+1 elements. n elements in it are
For 1.
sum the numbers in the file, subtract it from sum of first 4 billion
numbers.
On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta navneetn...@gmail.com wrote:
The answer to second question is simple. XORing all the elements
should do it for you.
On Thu, Jun 9, 2011 at 3:15 PM, Dumanshu
I think numbers in question1 are in sequence (ascending order).
2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com
For 1.
sum the numbers in the file, subtract it from sum of first 4 billion
numbers.
On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta navneetn...@gmail.comwrote:
The answer to
sum can overflow
Xor method can also be applied to Q1. no need of numbers to be sorted.
2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com
For 1.
sum the numbers in the file, subtract it from sum of first 4 billion
numbers.
On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta
Sum wont overflow, ULL range will include sum.
On Thu, Jun 9, 2011 at 3:52 PM, sunny agrawal sunny816.i...@gmail.comwrote:
sum can overflow
Xor method can also be applied to Q1. no need of numbers to be sorted.
2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com
For 1.
sum the numbers in
yes, but using xor no need of ULL :)
2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com
Sum wont overflow, ULL range will include sum.
On Thu, Jun 9, 2011 at 3:52 PM, sunny agrawal sunny816.i...@gmail.comwrote:
sum can overflow
Xor method can also be applied to Q1. no need of numbers to
Inversion means pair(i,j) such that ij and A[i]A[j]
--
**With Regards
Deoki Nandan Vishwakarma
IITR MCA
*
*
--
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
Discussed many times,
1) add some lines to merge sort
2) use Binary indexed tree for a faster version (i have not tried but get to
know it can be done using binary indexed tree)
On Thu, Jun 9, 2011 at 4:05 PM, D.N.Vishwakarma@IITR deok...@gmail.comwrote:
Inversion means pair(i,j) such that ij
thanx for suggestion
On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal sunny816.i...@gmail.comwrote:
Discussed many times,
1) add some lines to merge sort
2) use Binary indexed tree for a faster version (i have not tried but get
to know it can be done using binary indexed tree)
On Thu, Jun 9,
Insertion sort also would do.
On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR deok...@gmail.com wrote:
thanx for suggestion
On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal sunny816.i...@gmail.com
wrote:
Discussed many times,
1) add some lines to merge sort
2) use Binary indexed tree
how insertion sort will do in O(nlogn)?
On Thu, Jun 9, 2011 at 4:27 PM, Navneet Gupta navneetn...@gmail.com wrote:
Insertion sort also would do.
On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR deok...@gmail.com
wrote:
thanx for suggestion
On Thu, Jun 9, 2011 at 4:08 PM, sunny
I dont think numbers are sorted in the 1st question. btw
@sunny: how will xor-ing give the ans? for 1st ques?
On Jun 9, 3:34 pm, sunny agrawal sunny816.i...@gmail.com wrote:
yes, but using xor no need of ULL :)
2011/6/9 • » νιρυℓ « • vipulmehta.1...@gmail.com
Sum wont overflow, ULL
Ohh. Missed out the nlogn condition you mentioned. It will do but in n^2
Sent from my Windows Phone
--
From: D.N.Vishwakarma@IITR
Sent: Thursday, 9 June 2011 4:29 PM
To: algogeeks@googlegroups.com
Subject: Re: [algogeeks] Finding total number of inversions in an
Xoring it twice ...once with the elements in the file and then from i=1 to
4,000,000,000..the answer left is the missing number
On Thu, Jun 9, 2011 at 4:46 PM, Dumanshu duman...@gmail.com wrote:
I dont think numbers are sorted in the 1st question. btw
@sunny: how will xor-ing give the ans? for
Hi Snehi...Follow following links to kick-start your Swing!!
http://www.herongyang.com/Swing/Introduction-First-Swing-Program-SwingHello.html
http://www.herongyang.com/Swing/Introduction-First-Swing-Program-SwingHello.html
http://www.dreamincode.net/forums/topic/206319-first-swing-application/
Given a file containing roughly 300 million social security numbers(9-
digit numbers) find a 9-digit number that isnt there in the file. You
have unlimited drive space but only 2mb of RAM.
Solution is as follows:
In the first step, we build an array of 2^16 integers that is
initialized to 0 and
On Thu, Jun 9, 2011 at 5:01 PM, algogeeks+nore...@googlegroups.com wrote:
Today's Topic Summary
Group: http://groups.google.com/group/algogeeks/topics
- need help in Desktop applications #130742ba4deca0ba_group_thread_0[1
Update]
- MS Interview #130742ba4deca0ba_group_thread_1 [13
Ma approach is to xor the given number with all numbers in the file !!
This takes O(n)
I think we cant achieve a complexity O(n)
we have to scan the file at least once
Or move to this problem
Instead of a file with numbers
you have a stream of numbers
Create a Trie and insert every number from
check your this if condition
if(tmap.end()-second=4)
{
ans=tmap.end()-first;
}
it should be == , not =
On Thu, Jun 9, 2011 at 5:09 PM, John Hayes agressiveha...@gmail.com wrote:
Hello every one i tried to code the same problem using STL mapsbut
getting the RUN TIME
part 1 can be solved in O(1) complexity.. first adding all the numbers
and then subtracting it from 4,000,000,000 will give the result.
On Jun 9, 2:45 pm, Dumanshu duman...@gmail.com wrote:
Q1. I have a file in which there are supposed to be 4 billion
numbers,
starting from 1 to 4,000,000,000
so y did u give answer as 6 if it can b ny random no.?? xplain
On Thu, Jun 9, 2011 at 12:31 PM, sunny agrawal sunny816.i...@gmail.comwrote:
series of some random numbers generated ussing some RNG
no logic :P :P :P
On Thu, Jun 9, 2011 at 12:29 PM, Arpit Sood soodfi...@gmail.com wrote:
hehe
that was also random. :D
--
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
@sunny since PRG's are also not absolutely random, then did you actually
generate series of the form 20 6 150 18 11, or you just answered it
randomly, :D
@tech rascal
what's the actual answer ?
On Thu, Jun 9, 2011 at 5:46 PM, sunny agrawal sunny816.i...@gmail.comwrote:
hehe
that was also
answer is 6 only bt I don't knw the logic
On Thu, Jun 9, 2011 at 5:59 PM, Arpit Sood soodfi...@gmail.com wrote:
@sunny since PRG's are also not absolutely random, then did you actually
generate series of the form 20 6 150 18 11, or you just answered it
randomly, :D
@tech rascal
what's the
ha ha .
i answer randomly...:)
i don't like series questions, but this thread was sleeping so i posted for
fun :)
if this is right answer, lets try to think what was the author thinking
while forming such series
On Thu, Jun 9, 2011 at 6:03 PM, tech rascal techrascal...@gmail.com wrote:
+1
On Thu, Jun 9, 2011 at 3:10 PM, Naveen Kumar naveenkumarve...@gmail.comwrote:
Hi Moderators,
Can you please Ban Sohail from algogeeks?
We are receiving a lot of spams from him.
sohail.panz...@gmail.com
--
Cheers
Naveen Kumar
--
You received this message because you are subscribed
Is not it O(n)?
--- On Thu, 9/6/11, ankit arun talk.ankit...@gmail.com wrote:
From: ankit arun talk.ankit...@gmail.com
Subject: [algogeeks] Re: MS Interview
To: Algorithm Geeks algogeeks@googlegroups.com
Date: Thursday, 9 June, 2011, 11:49 AM
part 1 can be solved in O(1) complexity.. first
seems like got it..
there is 150 days difference between 20/6(20 june) and 18/11(18 November)
On Thu, Jun 9, 2011 at 6:14 PM, sunny agrawal sunny816.i...@gmail.comwrote:
ha ha .
i answer randomly...:)
i don't like series questions, but this thread was sleeping so i posted for
fun :)
gr8 man.awesome :)
On Thu, Jun 9, 2011 at 6:00 AM, sunny agrawal sunny816.i...@gmail.comwrote:
seems like got it..
there is 150 days difference between 20/6(20 june) and 18/11(18 November)
On Thu, Jun 9, 2011 at 6:14 PM, sunny agrawal sunny816.i...@gmail.comwrote:
ha ha .
i
Hello,
Here is the code :
#includestdio.h
int mergeandcountinversion(int a[],int begin,int middle,int end,int z)
{
int length=end-begin+1;
int tmp[length];
int i1=begin,i2=middle+1,it=0,i=0;
for(i=0;ilength;i++)
{
if(i1middle)
{
for(;i2=end;i2++)
{
tmp[it]=a[i2];
it++;
}
break;
}
if(i2end)
hey Karan... thanks a lot
the links are helpful :)
its an app. that can help in building one's vocab.
its basically a thought right now. Will ask more when things start taking
desired shape a little bit.
On Thu, Jun 9, 2011 at 4:59 PM, karan sachan karansac...@gmail.com wrote:
Hi Snehi...Follow
@sunny : if dats d answer...hats off to u man !!! ...seriously awesum
thinking !!
On Thu, Jun 9, 2011 at 7:01 PM, nicks crazy.logic.k...@gmail.com wrote:
gr8 man.awesome :)
On Thu, Jun 9, 2011 at 6:00 AM, sunny agrawal sunny816.i...@gmail.comwrote:
seems like got it..
there is 150
a volatile pointer to a volatile pointer to integer
int *volatile *p;
a pointer to a volatile pointer to interger
On Wed, Jun 8, 2011 at 11:28 AM, Vishal Thanki vishaltha...@gmail.comwrote:
Following declaration makes the x as a volatile pointer to an integer.
int *volatile x;
But what
awesome ..:)
On Thu, Jun 9, 2011 at 7:45 PM, bhavana bhavana@gmail.com wrote:
@sunny : if dats d answer...hats off to u man !!! ...seriously awesum
thinking !!
On Thu, Jun 9, 2011 at 7:01 PM, nicks crazy.logic.k...@gmail.com wrote:
gr8 man.awesome :)
On Thu, Jun 9, 2011 at 6:00
Need to compare large and adhoc files (the files may have 1 milliion rows)
in java.
So need to load these files in a datastructure and based on a set of rules ,
need to realign and compare these rows.
Can you advice which datastructure/Collection class is best fit.
Or anyway I need to custom code
Cant see my mail going out
On Fri, Jun 10, 2011 at 12:26 AM, vishnu madiga vishnu.mad...@gmail.comwrote:
Need to compare large and adhoc files (the files may have 1 milliion rows)
in java.
So need to load these files in a datastructure and based on a set of rules
, need to realign and
I this this code will solves it ...
*#include stdio.h
#include stdlib.h
struct node{
int val;
struct node *next;
};
int main(){
struct node *head = NULL , *next_ptr = head;
int n = 1;
while ( n = 6 ){
struct node *temp = (struct node*) malloc (sizeof(struct node)
@Aditya:- can u give a brief intro of volatile pointer.
Thanks.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/SJkBkvK-MqAJ.
To post to this group, send
74658 is the answer.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/tk1YfCtLvWkJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
here is my approach :
STEP 1: 300 million integers take 300*10^6*4 bytes of memory, but we
have only 2 MB RAM which 2*10^6. By dividing these, we get that we
need to break the file containing sequence of 300 million numbers into
around 600 files. Divide the bigger file into 600 smaller files.
hey... we have 300 million (9- digit) numbers. So we have to print a
number which isn't already there in the file.
We are not given that number beforehand. You are saying to check u
are going to check whether a number N exist .
On Jun 9, 4:46 pm, radha krishnan radhakrishnance...@gmail.com
wrote:
@Dumanshu: In each iteration, we r removing the smallest number. If
at any iteration we can't find the next smallest no., it means that
no. is missing.
On Thu, Jun 9, 2011 at 10:54 AM, Dumanshu duman...@gmail.com wrote:
hey... we have 300 million (9- digit) numbers. So we have to print a
Create a range tree, pruning out as needed to stay in the memory
constraint.
Don
On Jun 9, 6:24 am, Dumanshu duman...@gmail.com wrote:
Given a file containing roughly 300 million social security numbers(9-
digit numbers) find a 9-digit number that isnt there in the file. You
have unlimited
A helicopter drops two trains, each on a parachute, onto a straight
infinite railway line. There is an undefined distance between the two
trains. Each faces the same direction, and upon landing, the parachute
attached to each train falls to the ground next to the train and detaches.
Each train
http://www.spoj.pl/problems/IMPORT/
my code is
# includestdio.h
float max(float [],int);
void search(float [],char [],int ,float);
int p;
int main()
{
int t;
scanf(%d,t);
int i;
char ch[30]={0};
char a[30]={0};
float b[30]={0};
char f;
for(i=0;it;i++)
{
f=getchar();
After Sohail Panzer you have started sending your mails to the group. Please
leave this group. No one likes such kind of mails.
On Thu, Jun 9, 2011 at 8:48 PM, Prakash recruiter
prakash.recruite...@gmail.com wrote:
Dear Folks,
Wishes for the Day,
We need consultant for *SAP SCM-SD
Job done guys. Lets hope the other guy leaves too.
Shady.
-- Forwarded message --
From: sohail soh...@panzersolutions.com
Date: Thu, Jun 9, 2011 at 6:55 PM
Subject: Re: [algogeeks] Cisco Expert CCIE Engineer // Daytona Beach, FL //
3 weeks contract
To: shady sinv...@gmail.com
its done silly mistake...:(
--
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.
Game of master mind: you have four balls, and four different colors, as a
solution. The user tries to guess the solution. If they guess the right
color for the right spot, it counts as a 'hit'. If it's the right color, but
the wrong spot, it counts as a psuedo-hit. For example: if the solution is
lol.Don't bother.I too have fallen for scan till EOF scheme
On Fri, Jun 10, 2011 at 1:58 AM, kartik sachan kartik.sac...@gmail.comwrote:
its done silly mistake...:(
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
Problem link- ABCDEF https://www.spoj.pl/problems/ABCDEF/
Can someone please explain this problem.The problem says a,b,c,d,e,f belongs
to S.But what if size of S is smaller than 6?
I know i am missing sumthing very trivialhelp plz.
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
Ok got it...a,b,c,d,e,f need not be distinctSorry for bothering.
On Jun 10, 9:01 am, saurabh singh saurab...@gmail.com wrote:
Problem link- ABCDEF https://www.spoj.pl/problems/ABCDEF/
Can someone please explain this problem.The problem says a,b,c,d,e,f belongs
to S.But what if size of S
the nos can repeat :) ie the valid set may contain multiple instance of a
same number..
hope this helps :)
On Fri, Jun 10, 2011 at 9:31 AM, saurabh singh saurab...@gmail.com wrote:
Problem link- ABCDEF https://www.spoj.pl/problems/ABCDEF/
Can someone please explain this problem.The problem
#includeiostream
#includestring
using namespace std;
void mastermind(char* guess, char* sol, int *hits, int *pseudohits)
{
int temp[256] = {0};
int len1=strlen(sol);
int len2=strlen(guess);
while(--len1+1)
(guess[len1]==sol[len1]) ? ((*hits)+=1,temp[len1] = 1) : (temp[sol[len1]]
+=
@lalit:
The idea here would be for Train T,
make it cross its own parachute first. Then move both the train fwd
until
the trailing train reaches a parachute. When the trailing train
reaches the parachute
of the leading train, make it move faster than the leading train .
Naturally the leading
train
An algorithm is:
Have a bit array B of 256/65k size.
If an color 'i' is encountered in the solution, set its B[i]=1;
Traverse the solution array S,
if(S[i]==B[i]) hits++;
else if ( B[S[i]] ) pseudohits++;
On Jun 10, 9:40 am, Harshal
look for overlapping subproblems.Most of such problems have a recursive
solution possible with time complexity o(2^n) and using dp we can reduce the
subproblems and get solution of order polynomial.Thats one way of
recognizing dp problems.
On Fri, Jun 10, 2011 at 11:14 AM, kartik sachan
86 matches
Mail list logo