this is my solution http://ideone.com/49SCl3 for spoj problem
http://www.spoj.com/problems/MRECAMAN/en/
could anyone pls say why am i getting TLE
THANKS IN ADVANCE
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
this is my solution http://ideone.com/49SCl3 for spoj problem
http://www.spoj.com/problems/MRECAMAN/en/
could anyone pls say why am i getting TLE
THANKS IN ADVANCE
this is my solution
http://ideone.com/FB9VxG for the following problem http://mirror.codeforces.com/contest/572/problem/B
i really worked hard for this problem...but i couldnt find any wrong in my solution...
could anyone pls point out wrong in my solution...
pls help me..
thanks in advance
recently i wrote a program on doubly linbked list.....this is my code
i coulod able to put number at any position except at end.....could you pls tell whats wrong in this code.
THIS WAS MY QUESTION ..BUT LATER I SAW THE CODE TWICE ....AND GOT THE ERROR..
i got it...in doubly linked list.....when you are inserting a noe at the end....see that you are not using thsi step...
"temp1->next->prev=temp1;"
so....take a global variable 'l' which keeps track of length of list....when list length is equal to your inserting position ,dont use that line....
check modified code below
hope this helps for beginners of linked list.
i used the following lazy propogation to update my tree...like i wanted to get sum of [i,j]
my input was n=8;all elements set to zero.'0'.
then i gave my array number 26 to update array from i=1 to i=3;[1,3]
but i am getting tree[1]=52 instead of 78....
could any one say where i am getting wrong.....
thanks in advance
sir....the following code....i used succesfully compiled and got correct answer...i.e insert a number at end position...this is my code
but first time i got wrong because in print fuction in while loop i used "temp->next!=NULL" instead of "temp".....could any one say why did i get wrong...before.
could any one pls explain the following problem clearly so that a beginner could understand
could any one pls say how to solve this problems....and also say some prerequisites to solve this problem....
https://www.codechef.com/COFU2015/problems/LINGRP
thanks in advance...
could any one pls say logic of solving below problems....
https://www.codechef.com/COFU2015/problems/LINGRP
https://www.codechef.com/COFU2015/problems/LINXOR
thanks in advance
Sir..I tried the below question ..I got the correct answer for all test cases.but I got TLE due to constraints..then I saw some users solutions..they did that problem with a formula...but I wonder what is that formula....could any one explain how to get AC with in time limit..and explain that formula clearly..how did they get it. https://www.codechef.com/PROCON15/problems/PRCNSR1
Thanks
could any one say clear logic behind this problem.
recently....i came across a problem on spoj...NGM2.. http://www.spoj.com/problems/NGM2/
i think many dont concentrate on this topic.....i am one.....i know how to solve this problem....but couldnt write code.....could any one post code for this problem in c.
sir..i am dp beginner....i solved the following problem with brute-force.....but i want to know approach for DP solutions.....
pls explain the approach clearly...
thanks in advance
i solved "longest common subsequnce" problem....there the elements need not to be contiguous....but whn i saw a video on maximum subsequence sum....he said sequnce has to be contiguous.....
i am confused which one to follow....
pls clear...
Hello...I am a dream coder...and now I want to master dynamic programming...recently I solving the following problem....
i saw the ditorial,,,,but dp solution was not given.
could any one explain dp code for below problem.i am dp beginner
Thanks in advance
Hello...I am a dream coder...and now I want to master dynamic programming...recently I solving the following problem....but couldn't understand the editorial.
Could any one pls explain this problems solution clearly..for a DP beginner.....
Thanks in advance
Hello...I am a dream coder...and now I want to master dynamic programming...recently I solving the following problem....but couldn't understand the editorial.
Could any one pls explain this problem clearly..for a DP beginner.....
Thanks in advance
http://mirror.codeforces.com/contest/460/problem/C
can any one pls explain how to do this problem through binary search.
using namespace std; long long i,n,k,m[200010],w,l,r,z,a[200010],kol,sum,p; int main(){ //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); cin>>n>>k>>w; for (i=0;i<n;i++) cin>>m[i]; l=1; r=10; while (l<=r){ z=(l+r)/2; kol=0; sum=0; for(p=0;p<10;p++) a[p]=0; for ( i=0;i<n && kol<=k;i++){ sum=sum+a[i]; if (m[i]+sum<z){ kol=kol+z-(m[i]+sum); a[i+w]-=z-(m[i]+sum); sum=z-m[i]; } } if (kol<=k) l=z+1; else r=z-1;
}
cout<<r;
return 0;
} here is one of the codes and i couldnt understand any thing at all.
COULD SOME ONE PLS EXPLAIN THIS QUESTION CLEARLY.pretty confused.
Name |
---|