COUPON--getting wrong o/p though my solution is giving the right one
//Though I am getting the correct output it shows wrong output..someone please help include<stdio.h>int main() {int m,n,i,j,pp,t,k; scanf("%d",&t); while(t--) { scanf("%d%d",&m,&n);...
View ArticleCan I get back the karma that I've awarded to someone?
I was going through the questions on the codechef forum, while reading @betlista's answer for http://discuss.codechef.com/questions/4240/why-the-program-showing-runtime-error , I thought the answer was...
View Articleproblem with printf
here is my code char *str="ABCDE" ; printf(str,"%s \\n "); the answer of this is ABCDE .. there is no runtime error in the code it runs fine.. all i dint understood was why the \n is no printed just...
View ArticleWhat is Time to run in email?
Hi, I keep getting time limit exceeded. After submitting I get an email back with some "Time to run", what does this "Time to run" mean? I keep getting 2.01s.Submission Time: 2013-07-07 15:45:43 IST...
View Articleworking of printf in C
Can anybody please explain me the output of following codechar *str="ABCDE" ; printf(str,"%s \\n "); printf("%s\\n",str); O/P-ABCDEABCDE\nthanx in advance
View Articleprogramming challenge question
Jerry Yang is going to visit Berkeley for the launch of his new book and naturally there’s a lot of excitement amongst students in the campus. He wants to make the launch interesting by playing a game....
View ArticleAlgorithm: Given an array, find all the pairs of elements whose sum is k.
algorithm for:-----Given an array, find all the pairs of elements whose sum is k.
View Articlehash table search expected time
why In a hash table in which collisions are resolved by chaining an unsuccessful search and successful search both have same time complexity o(1+@). where @ is a load factor. reply soon
View ArticleWhy do I get a Compilation error?
i have tested this code on my computer while using Turbo c++ . but this is not compiling in c++ 4.0.0-8.#include<iostream.h> #include<conio.h> void main() { int x; float y; cin>>x;...
View Articlehashing by division
Hashing using division method means h(k) = k mod m . I read thatm should not be power of 2. This is because if m = 2^p, h becomes just the p lowest-order bits of k. Usually we choose m to be a prime...
View ArticleModulo problem
given array Numerator[] = { a1 , a2 , a3 .. an } and Denominator[] = { b1 , b2 , b3 .. bn }we have to find ((a1.a2.a3 ... an)/(b1.b2.b3 ... bn)) % P given that final value will always be a integer..
View ArticleNUKES easy
for(int j=0;j<k;j++){ System.out.print(a%n+" "); a=a/n; } i don't get the logic of the above block and how it can easily solve the nuke problem...!
View Articletime complexity of single and double link list
i am little confused over the time complexity of single and doubly link list operation.for a single link list deletion takes o(n) time which is clear since first we have to search and for the worst...
View ArticleWhy I am i getting a wrong answer??
Pooja would like to withdraw X $US from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal...
View ArticleRestriction on submissions per minute
I know that the restriction of 1 submission per 30 seconds is put because people submit a lot of codes continuously. But i think that it is only for challenge problem.Then why is this restriction put...
View Articlesimply divide
how to perform operations like % and / on numbers of about 20 digits i.e >2^64 ....... unsigned long long doesnt work beyond 2^64
View ArticlePrime Palindromes easy
import java.io.BufferedReader; import java.io.InputStreamReader; class test { public static boolean ispallin(String n) { StringBuffer a = new StringBuffer(n); if(n.equals(a.reverse().toString())) {...
View ArticleTSORT, I got wa
I have tested this with the sample input and with my own input, and I don't know why I got wa. Can someone take a look at it?http://www.codechef.com/viewsolution/2337452
View ArticleTranslate this program to python
translate this into python....#include<iostream.h> main() { int t; unsigned long long x,n,noc; cin>>t; while(t--) { cin>>x>>n; noc=x; while(noc>=n) { x++; noc=noc-n+1; }...
View ArticleRUNTIME ERROR IN ANARC
Why is this code giving segmentation fault? The stack has been handled properly.#include<stdio.h> #include<string.h> char pop(char * ); void push(char *,char); int change(char *,int); int...
View Article