Search found 148 matches

by Shahidul.CSE
Thu Nov 06, 2014 11:16 am
Forum: Volume 113 (11300-11399)
Topic: 11310 - Delivery Debacle
Replies: 19
Views: 10166

Re: 11310 - Delivery Debacle

Sample input: 40 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Sample output: 1 5 11 33 87 241 655 1793 4895 13377 36543 99841 272767 745217 2035967 5562369 15196671 41518081 113429503 309895169 846649343 2313089025 6319476735 17265131...
by Shahidul.CSE
Sat Oct 25, 2014 7:33 pm
Forum: Volume 128 (12800-12899)
Topic: 12834 - Extreme Terror
Replies: 4
Views: 1953

12834 - Extreme Terror

I am getting TLE. Whats the alternative way? #include<stdio.h> long long exp[1000000],gave[1000000]; int main() { long long int t,n,k,c,i,j,tExp,tGave,sub,temp,den; scanf("%lld",&t); for(c=1;c<=t;c++) { scanf("%lld %lld",&n,&k); tExp=tGave=0; for(i=1;i<=n;i++) { scanf("%lld",&exp[i]); tExp+=exp[i]; ...
by Shahidul.CSE
Wed Oct 01, 2014 1:25 pm
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 38250

Re: 706 - LCD Display

Thanks, bryanfry713, got AC. :D
by Shahidul.CSE
Mon Sep 29, 2014 8:34 pm
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 38250

Re: 706 - LCD Display

brianfry713 wrote:For code 1 on the sample input you're printing extra blank lines at the end.
Ok, I also noticed it when I check output for sample input. But couldn't fix it :(

But whats wrong with 2nd code? It looks fine for different cases, but why getting WA? Please help me for 2nd code.
by Shahidul.CSE
Mon Sep 29, 2014 6:48 pm
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 38250

Re: 706 - LCD Display

Code: Select all

Code Removed
by Shahidul.CSE
Mon Sep 29, 2014 4:36 pm
Forum: Volume 125 (12500-12599)
Topic: 12555 - Baby Me
Replies: 4
Views: 1544

Re: 12555 - Baby Me

Thanks lighted ! I now understood it :D
by Shahidul.CSE
Sun Sep 28, 2014 2:46 pm
Forum: Volume 124 (12400-12499)
Topic: 12461 - Airplane
Replies: 1
Views: 1237

Re: 12461 - Airplane

Please give me some sample input and output.
by Shahidul.CSE
Sat Sep 27, 2014 7:14 am
Forum: Volume 125 (12500-12599)
Topic: 12555 - Baby Me
Replies: 4
Views: 1544

Re: 12555 - Baby Me

1) In this problem, do ? and ? hold space of three characters each? Because, my compiler (CodeBlocks) shows the length of first simple input (i.e. 35 ?2 ?) is 11, length of 2nd simple input also 11, and the length of the last simple input is 5. 2) Shouldn't the output contain any trailing zero after...
by Shahidul.CSE
Sat Sep 20, 2014 1:58 pm
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 21108

Re: 10168 - Summation of Four Primes

Thanks lighted !

So it seems that only for N<8 it is impossible otherwise there must be a solution.

Another thing is to find all prime upto 10000000, which is take times 10 sec. So isn't it possible to find any two prime for (N-4) or (N-5), within the primes upto 1000000 or 100000?
by Shahidul.CSE
Fri Sep 19, 2014 9:10 pm
Forum: Volume 101 (10100-10199)
Topic: 10168 - Summation of Four Primes
Replies: 51
Views: 21108

Re: 10168 - Summation of Four Primes

I am getting TLE with bellow code. But I got accepted in this way in problem Golbach's Conjecture and Golbach's Conjecture(II). where to change? #include<stdio.h> int isPrime(long num) { long i; for(i=2;i<=num/i;i++) if(num%i==0) return 0; return 1; } int main() { long i,k=1,j,prime[78600],n,a,b,c,d...
by Shahidul.CSE
Fri Sep 19, 2014 11:17 am
Forum: Volume 125 (12500-12599)
Topic: 12502 - Three Families
Replies: 23
Views: 10360

Re: 12502 - Three Families

mhsn06 wrote:what will be the output for this?

Code: Select all

1
6 2 500
For this case, my Accepted code gives output:

Code: Select all

625
by Shahidul.CSE
Fri Sep 19, 2014 8:45 am
Forum: Volume 122 (12200-12299)
Topic: 12290 - Counting Game
Replies: 5
Views: 1512

Re: 12290 - Counting Game

Got AC :) Some more test Cases Input : 100 7 1 100 7 2 100 7 3 2 1 1000 77 7 77 77 77 77 19 19 27 0 0 0 OutPut : 7 787 799 4579 10787 25157 1855 My code is giving correct output for all the cases except the last two cases. for 77 77 77 its giving 25158 instead of 25157 and for 19 19 27 its giving 1...
by Shahidul.CSE
Wed Sep 17, 2014 6:04 pm
Forum: Volume 125 (12500-12599)
Topic: 12502 - Three Families
Replies: 23
Views: 10360

Re: 12502 - Three Families

Thanks, lighted ! Got accepted :D
by Shahidul.CSE
Tue Sep 16, 2014 8:57 pm
Forum: Volume 2 (200-299)
Topic: 255 - Correct Move
Replies: 17
Views: 4600

Re: 255 - Correct Move

Thank you sir,
Now got accepted!
I made a little mistake for legal moves loop, I used i<=l instead of i<l .
What a stupid mistake !! :)
by Shahidul.CSE
Tue Sep 16, 2014 8:56 pm
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 25380

Re: 465 - Overflow

Thank you, sir
Got Accepted!

Mistake was that I calculated value for ans using l<flen instead of l<alen [flen = > length of first number, alen=>length of ans]

What a silly mistake and a stupid I am that I couldn't find it out! :)

Go to advanced search