@ kuldeep thanks...that wrked..bt still cud nt understand that what difference making that global made..
On 4/13/12, Rishabh Jain <[email protected]> wrote: > @ raminder.. its clear that number cannot be specified in same list > twice..even asked in a comment from admin. > > On 4/13/12, Ramindar Singh <[email protected]> wrote: >> You have not taken care of the test case where the number is repeated >> more >> than once in a single list and is not there in other lists. >> >> Problem desc - "the final list including only those ID numbers that >> appeared in at least 2 out of the 3 lists" >> >> so it should not display the numbers which appear more than once in a >> single list and are not there in other lists. >> >> Thanks... >> >> On Friday, 13 April 2012 10:01:12 UTC+5:30, rishbhjain wrote: >>> >>> http://www.codechef.com/problems/VOTERS >>> >>> >>> Here is my solution >>> Dont know y i m getting Runtime error..plz check.. >>> >>> #include<cstdio> >>> #include<algorithm> >>> using namespace std; >>> int main() >>> { >>> int a,b,c,x[50001],i; >>> int s[100001],count; >>> s[100001]=0; >>> count=0; >>> //freopen("fun.txt","r",stdin); >>> scanf("%d%d%d",&a,&b,&c); >>> for(i=0;i<a;i++) >>> { >>> scanf("%d",&x[i]); >>> s[x[i]]++; >>> } >>> for(i=0;i<b;i++) >>> { >>> scanf("%d",&x[i]); >>> s[x[i]]++; >>> } >>> for(i=0;i<c;i++) >>> { >>> scanf("%d",&x[i]); >>> s[x[i]]++; >>> } >>> for(i=0;i<100000;i++) >>> { >>> if(s[i]>1) >>> count++; >>> } >>> printf("%d\n",count); >>> for(i=0;i<100000;i++) >>> { >>> if(s[i]>1) >>> printf("%d\n",i); >>> } >>> return 0; >>> } >>> >>> >> >> -- >> 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/-/8x94LJfb1EgJ. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
