http://www.spoj.com/problems/AMR10D/
A number is a multiple of 11, when its digits are given alternate signs
(starting with positive from right) and added w.r.t the signs gives a
number modulo 11.
The question is asking to partition the given numbers into two groups say
S1 and S2 such that
On Wed, May 22, 2013 at 9:45 AM, emmy foramlakh...@gmail.com wrote:
problem : http://www.spoj.com/problems/FARIDA/
what is wrong with this code? The algorithm is pretty straight forward
Is it ?
1000 1 1 1000
Your code gives 1001 as output. Desired output should be 2000.
--
You received
problem : http://www.spoj.com/problems/FARIDA/
what is wrong with this code? The algorithm is pretty straight forward
#includestdio.h
#includestdlib.h
int main(void)
{
int t,n,i;
scanf(%d,t);
long long int s1,s2,s=0,a,temp;
int c=1;
while(t--)
{
scanf(%d,n);
I have been trying to solve this problem -
http://www.spoj.com/problems/ABA12C/
but am getting continuous WA.
Now i have found a test case where my code gives wrong answer but am not
able to find the fault in the logic. please help!!
The code along with the test case for which i am getting
I have been trying to solve this problem using DP. i managed to realize the
problem in the form of recurrence..
The solution is:
Suppose the task was : given N pilots you have to assign N/2 of them as
captains and N/2 as assistances. Furthermore you need to do this in a way
such that for every
Could you post the test case you failed? Then we can have a check.
2013/5/12 Piyush Raman piyush2011...@gmail.com
I have been trying to solve this problem using DP. i managed to realize
the problem in the form of recurrence..
The solution is:
Suppose the task was : given N pilots you have
The test cases are not public. Gonna have to find the bug in the logic!
Here's the link of the problem statement:
http://www.spoj.com/problems/MPILOT/
On Mon, May 13, 2013 at 1:36 AM, Tian Guo tian@epfl.ch wrote:
Could you post the test case you failed? Then we can have a check.
Great! Thanks!
I think one possible problem is that for f[c][m], the range of m should
bem= [0, min(c/2, n/2)]
In your code, m is only related to n/2.
2013/5/12 Piyush Raman piyush2011...@gmail.com
The test cases are not public. Gonna have to find the bug in the logic!
Here's the
http://www.spoj.com/problems/NWERC11A/
I have been trying to solve this problem but am getting TLE for larger
inputs.
Can't come up with an optimal approach!!
--
Using KISS :)
http://en.wikipedia.org/wiki/KISS_principle
Ps: is not an offensive message
Wladimir Araujo Tavares
*Federal University of Ceará http://lia.ufc.br/%7Ewladimir/
Homepage http://lia.ufc.br/%7Ewladimir/ |
Maratonahttps://sites.google.com/site/quixadamaratona/|
*
On Fri, Sep 28,
@Wladimir : you have to use formula given in below link
http://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle
On Fri, Sep 28, 2012 at 12:26 AM, Wladimir Tavares wladimir...@gmail.comwrote:
what happens when a = 3, d = 5
a, a + d, d +2, a +3 d = 3,8,13,18?
Wladimir Araujo
why not just brute force this? one little array contains [a, (a+d),
(a+2d), (a+3d), (a+4d) ], which is then filtered so that none of those are
multiples of another.
Then set a count variable to m-n+1. Check all numbers in range against
your little array, decrementing count and breaking out if a
thanks for your reply.. actually i was thinking the same thing.. but I am
facing problems in finding the unique multiples of a+3d and a+4d as
applying inclusion exclusion principle in this way is getting too difficult
due to large no of factors to be added and subtracted.. is der any other
@ashish : here is the generalized equation
http://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle
note : you need to take LCM of a,a+d,a+2d etc etcwhenever you are
dividing to find count
On Thu, Sep 27, 2012 at 2:55 AM, ashish pant asheesh...@gmail.com wrote:
thanks for
what happens when a = 3, d = 5
a, a + d, d +2, a +3 d = 3,8,13,18?
Wladimir Araujo Tavares
*Federal University of Ceará http://lia.ufc.br/%7Ewladimir/
Homepage http://lia.ufc.br/%7Ewladimir/ |
Maratonahttps://sites.google.com/site/quixadamaratona/|
*
On Thu, Sep 27, 2012 at 8:57 AM, atul
an idea of the approach would be enough.. plz help..
--
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
help needed in spoj problem EASYMATH http://spoj.pl/problems/EASYMATH.. i
thought about inclusion exclusion principle but unable to get to a
solution.. plz help..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the
please suggest something :
Problem :
http://www.spoj.pl/problems/EASYMATH/
C++ code :
http://ideone.com/r2OSb
was getting wrong ans due to over flow i think in LCM() for big prime's i guess.
thin tried in python .
Now getting NZEC for python code which mean's high level or recurrsion
some
use return (a/gcd(a,b)*b instead
On Sun, Jun 24, 2012 at 7:10 PM, Sourabh Singh singhsourab...@gmail.comwrote:
please suggest something :
Problem :
http://www.spoj.pl/problems/EASYMATH/
C++ code :
http://ideone.com/r2OSb
was getting wrong ans due to over flow i think in LCM() for big
dont post codes, ask whether your algorithm is correct or not.
On Sun, Jun 24, 2012 at 8:29 PM, Hassan Monfared hmonfa...@gmail.comwrote:
use return (a/gcd(a,b)*b instead
On Sun, Jun 24, 2012 at 7:10 PM, Sourabh Singh
singhsourab...@gmail.comwrote:
please suggest something :
Problem
@MAYANK your output format is wrong.use printf(\nScenario #%d:\n,(i+1));
and
if(sum sta)
On Thu, Jun 21, 2012 at 12:34 PM, Mayank Singh
singh13490may...@gmail.comwrote:
here is my code
/*#includestdio.h
#includeconio.h
int main()
{
int cand,sum;
int T,N,i,j,temp[10];
use if(sum sta) instead of if(sum=sta)
because in case sum==sta..your code will still increment p .but the value
of p should not be incremented in this case.and in your output format colon
: should be placed before \n to follow the format specified for the problem.
On Fri, Jun 22, 2012 at 12:48
in this prob also
for i=0, i to k
read cand
rem=(rem+cand)%k
if (rem) then no
else yes
--
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
my code is running perfectly well but giving WA in spoj..
#includestdio.h
#includestdlib.h
int main()
{
int cand,sum;
int T,N,i,j,temp[10];
scanf(%d,T);
sum = 0;
for(i=0;iT;i++)
{
scanf(%d,N);
for(j=0;jN;j++)
{
scanf(%d,cand);
i think you should try to give output for each test case rather to use any
temp array
--
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
here is my code :
#includestdio.h
#includestdlib.h
int main()
{
long long cand,sum;
int T,N,i,j,*temp;
scanf(%d,T);
temp= (int*)calloc(T, sizeof( int));
sum = 0;
for(i=0;iT;i++)
{
scanf(%d,N);
for(j=0;jN;j++)
{
scanf(%lld,cand);
Initialize sum as zero for all test cases ie inside 1st for loop.
On Jun 21, 2012 5:22 PM, Mayank Singh singh13490may...@gmail.com wrote:
here is my code :
#includestdio.h
#includestdlib.h
int main()
{
long long cand,sum;
int T,N,i,j,*temp;
scanf(%d,T);
temp=
@Mayank coding style not seems gud.. try this...
int main()
{
int testCases;
scanf(%d,testCases);
while(testCases--0)
{
//perform ur logic
//print output for each test case here instead of storing it into
an array.
}
}
return 0;
}
On Thu, Jun 21, 2012 at 10:35 PM,
#includeiostream
using namespace std;
struct node
{
int num;
int l,r;
node * left;
node * right;
};
node * create(node * root,int start,int end);
node * update(node * root, int i,int j);
int query(node * root,int i,int j);
main()
{
int n,q;
cinnq;
node *
i am using long long but still getting WA.
here's my code
#includestdio.h
#includeconio.h
int main()
{
long long cand,sum;
int T,N,i,j,temp[10];
scanf(%d,T);
sum = 0;
for(i=0;iT;i++)
{
scanf(%d,N);
for(j=0;jN;j++)
{
long long not require in this que .
try it again..
--
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
still getting the WA .
is there any test case i am getting wrong?
--
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
here is my code u can check that..
http://ideone.com/Gii1d
--
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
@mayank:
For each testcase sum is not zero make sum=0 inside the for loop
--
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
oh i am really sorry
the problem is CANDY III
can you help me regarding that
once again sorry
--
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
Hi,
I am trying to solve this problem.
http://www.spoj.pl/problems/SCUBADIV/
But I am getting a lot of WAs!
Any good logic(Solution) to solve the problem?
Thanks in advance for your reply.
Rituraj
2nd year
B.Tech(CSE)
NIT-Patna
--
You received this message because you are subscribed to
here is my code:
#includestdio.h
#includestring.h
#includestdlib.h
int main()
{
int t,i,j,k1,k2,ans[40],sum,sum1;
char str[40][20],str1[6],str2[6];
scanf(%d,t);
for(i=0;i=t;i++)
{
gets(str[i]);
}
for(i=1;i=t;i++)
{
for(j=1,k1=0;j15,k15;j=j+3,k1++)
here is my code for the above problem:
#includestdio.h
#includestdlib.h
int main()
{
int i,x[1],y[1],val;
long n;
scanf(%d,n);
for(i=0;in;i++)
{
scanf(%d,x[i]);
scanf(%d,y[i]);
}
for(i=0;in;i++)
{
if(x[i] == y[i] x[i]%2 == 0)
array size not sufficient coz n can be greater than 1
try x[100], y[100] :-)
On Sun, Jun 17, 2012 at 9:32 PM, Mayank Singh
singh13490may...@gmail.com wrote:
here is my code for the above problem:
#includestdio.h
#includestdlib.h
int main()
{
int i,x[1],y[1],val;
plz nyone explain how to approach this problem..
http://www.spoj.pl/problems/XORROUND/
--
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
@ashish pant
We must compute all the queries in O(n)+O(k).
We must have array like counting array.
It is not my logic but my friend told about this logic
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
in 1 2 3 4 5 6...o/p ll b 5
--
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/-/eWlM2oyysowJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
not abe to get solution
On Mon, Feb 13, 2012 at 10:49 AM, atul anand atul.87fri...@gmail.comwrote:
what problem are you facing ...???
On Thu, Feb 9, 2012 at 12:01 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.com wrote:
I have been doing this question for a time but was not able to solve it.
what will the output of following input:
1) 1 2 3 4 5 6
2) 1 2 3 4 5 6 7
i am bit confused.because in the given link for input 2 ...output is
2but it should be written in this foam 2 1...
because 1 stands right of 2 so output should be 1...
On Mon, Feb 13, 2012 at 1:41 PM, UTKARSH
what problem are you facing ...???
On Thu, Feb 9, 2012 at 12:01 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:
I have been doing this question for a time but was not able to solve it.
It is based josephus problem ? Has anybody any idea
http://www.spoj.pl/problems/WTK/
--
*UTKARSH
I am solving spoj problem Tiling a Grid With
Dominoes.(http://www.spoj.pl/problems/GNY07H/)..
I am not able to come up with a recurrence relation..
One of my friend said it has the recurrence relation as f(n) = f(n-1)
+ 5*f(n-2) + f(n-3) - f(n-4).
I am not convinced and have trouble deriving this
well i have used three recurrences :P formed them by following a
traditional approach
f[i] = f[i-1] + 2*g[i-1] + h[i-1] + f[i-2];
g[i] = f[i-1] + g[i-1];
h[i] = f[i-1] + h[i-2];
On Thu, Feb 9, 2012 at 7:19 PM, Kunal Patil kp101...@gmail.com wrote:
I am solving spoj
I have been doing this question for a time but was not able to solve it. It
is based josephus problem ? Has anybody any idea
http://www.spoj.pl/problems/WTK/
--
*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*
--
You received this message because you are subscribed to the Google
Hi all I was doing this problem on spoj and it is running correctly on
my system and ideone. But when I submit it, it gives me SIGSEGV. Even
after 2 days research I am unable to find the cause. Please
help!!!
The code is
http://ideone.com/8aZLM
PS- If it shows correct
No one is going to check my your code
Don't submit my code directly to spoj ,,,Learn from it...and then
make your own code..
#includeiostream
#includevector
#includeset
#includemap
#includequeue
#includestack
#includestring
#includealgorithm
#includefunctional
#includeiomanip
@Anshul AGARWAL
Input :
4
2 1 3 4
Expected Output :
Yes
Your's Code Output :
No
On 12/20/11, sunny agrawal sunny816.i...@gmail.com wrote:
@ Anshul
it will be nice if you post your logic rather than Code, and also Code
posting without logic and comments is not allowed in the group. i
don't
Thanx Sharad
finally got AC
*Anshul Agarwal
Nit Allahabad
Computer Science**
*
On Tue, Dec 20, 2011 at 3:16 PM, sharad dixit sharad.emine...@gmail.comwrote:
@Anshul AGARWAL
Input :
4
2 1 3 4
Expected Output :
Yes
Your's Code Output :
No
On 12/20/11, sunny agrawal
I am getting a lot of tle's for this problem.
https://www.spoj.pl/problems/BUGLIFE/
Here is my code
#includeiostream
#includecstdio
#includecstring
using namespace std;
int g[2001][2001];
int color[2001];
short stack[5001];
int bugs, rel;
int inline complement(int n);
bool inline dfs();
int
problem is http://www.spoj.pl/problems/ELEVTRBL/
and my solution is give wrong answer on spoj . Plz help me to find in which
case my solution give wrong answer.
*
#includeiostream
**
#includestdio.h
using namespace std;
int main()
{
long long int f,s,u,d,g,c,p;
what;s your algorithm ?
On Mon, Nov 14, 2011 at 7:57 PM, Anshul AGARWAL
anshul.agarwa...@gmail.comwrote:
problem is http://www.spoj.pl/problems/ELEVTRBL/
and my solution is give wrong answer on spoj . Plz help me to find in
which case my solution give wrong answer.
*
#includeiostream
**
i m try to increase current floor c by push up button until it equal or
greater than g and increase co-responding push p.when my current
floor is greater than g.i push down button once and increase p by 1.
repeat this loop until i get c==g.
*Anshul Agarwal
Nit Allahabad
Computer Science**
*
one solution is use BFS
On Mon, Nov 14, 2011 at 8:52 PM, Anshul AGARWAL
anshul.agarwa...@gmail.com wrote:
i m try to increase current floor c by push up button until it equal or
greater than g and increase co-responding push p.when my current
floor is greater than g.i push down button once
Can you tell why (x * z * z) % MOD is different from (x * ( (z*z)%MOD) ) %
MOD
Again why ((x%MOD)*(z%MOD)*(z%MOD))%MOD is giving WA
I thought of a simple examples like
(100* 53*72) % 90
-- ((90+10)*53*72) % 90
-- (10*53*72)% 90 which is same as (100%90 * 53%90 * 72%90) % 90
Another
As far as modular arithmetic is concerned,
(x * z *z )%MOD = (x *(z *z)%MOD)%MOD = ((x%MOD)*(z%MOD)*(z%MOD))%MOD
But when you try to calculate *(x * z * z)%MOD*, the intermediate result of* (x
* z * z) *overflows the integer limit and hence gives the wrong result.
similarly, intermediate value
Just a MINOR change.
please change the RED line(I've marked it below) in your code by the
following line:
*return (x*((z*z)%MOD))%MOD;*
and enjoy an *ACCEPTED *verdict.*
*
*Wasif Hossain**
*
B.Sc. Student of Final Semester,
Computer Science and Engineering(CSE),
Bangladesh University of
I'm getting WA on the question : ZSUM-SPOJhttps://www.spoj.pl/problems/ZSUM/
Here is my code: Let me know if you can find the problem with the code
#includecstdio
#define MOD 1007
typedef unsigned long long u64;
using namespace std;
u64 modExp(u64 x, u64 y){
if(x==0)
return 0;
http://www.spoj.pl/problems/POUR1/
hw the 2nd given test is correct.
2
3
4
first we fill 3 littre jar with water and put into 4 littre jar den
again fill 3 littre and pour it in 2 littre remaining water in jar is
1 littre put it into 4 littre and we can measure 4 littre of water den
why answer is
http://www.spoj.pl/problems/PIE/
I solved this using Binary Search its similar to shake shake shaky of
spoj... but still get WA :(
Plzz help...
#includeiostream
#includealgorithm
using namespace std;
bool solve(int *pie, int n, int mid,int f)
{
int sum = 0;
for (int i=0; in; i++)
One small observation, you can use the M_PI constant already available
when you #include cmath
On Thu, Sep 15, 2011 at 3:57 PM, KK kunalkapadi...@gmail.com wrote:
http://www.spoj.pl/problems/PIE/
I solved this using Binary Search its similar to shake shake shaky of
spoj... but still get WA :(
I am getting WA in this problem, I am not getting what i am doing wrong
.
http://www.spoj.pl/problems/AE2A/
My dp is:
dp[n][k] = (dp[n - 1][k - 1] + dp[n - 1][k - 2] + dp[n - 1][k - 3] + dp[n -
1][k - 4] + dp[n - 1][k - 5] + dp[n - 1][k - 6])
and my code:
#includeiostream
using namespace
Description of the problem and your solution could help others.
On Wed, Sep 7, 2011 at 12:01 AM, Akshata Sharma
akshatasharm...@gmail.com wrote:
I am getting WA in this problem, I am not getting what i am doing wrong
.
http://www.spoj.pl/problems/AE2A/
My dp is:
dp[n][k] = (dp[n - 1][k -
@rahul, yes i agree with what you said, but I don't think that this is
causing WA here.. Its equivalent as if u take 2 1-darrays.. right?
On Wed, Sep 7, 2011 at 8:25 AM, rahul vatsa vatsa.ra...@gmail.com wrote:
if you are allocating memory for a n-d array, u shouldn't allocate memory
for each
check this test case
i/p
2 1 5
1 9
0
o/p
9
your code gives 12...
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
http://gplus.to/amolsharma99
http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://youtube.com/amolsharma99
hi see the logic all the factors of a number are evenly distributed about
it's square root
for e.g 100
1 X 100
2 X 50
4 X 25
5 X 20
10 X 10
AFTER THIS THE PAIRS REPEATE THEMSELVES BUT IN OPPOSITE ORDER
20 X 5
25 X 4
50 X 2
100 X 1
SO IF YOU MAKE YOUR LOOP GO TO SQRT(N) AND IF YOU FIND A FACTOR OF
it can be simply done in O(sqrt(n))
--
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
I am trying to submit solution for the SPOJ
DIVSUMhttps://www.spoj.pl/problems/DIVSUM/problem, but it returns the
*time limit exceeded*. Code submitted by me is below:
#include cstdlib
#include iostream
using namespace std;
int proper_divisor(int number);
int main()
{
int test,i,number;
@gaurav Thanks dear
Could you please explain the algorithm.
--
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/-/TNa8UygkzGkJ.
To post to this group, send
Yeah, sorry I was giving a hint for DIVSUM2, which is a much harder
version of DIVSUM.
You are checking all numbers less than n for divisibility. This is O(n).
Figure out how can you find the set of divisors using primes. This can
be done in O(2^d), if there are d prime divisors.
On Sat, Aug
i am getting repeatdly WA in this question link is
https://www.spoj.pl/problems/ACODE/
plzz provide me some test cases where my code
fails.
my code is
# includecstdio
# includecstring
int main()
{
while(1)
{
char a[50100];
scanf(%s,a);
Hi everybody,
I am trying to solve the below mentioned SPOJ problem. I am not getting that
how it returns *11 56 *in 3rd test.
SPOJ Problem: http://www.spoj.pl/problems/CMPLS/
Sincerely,
Rahul Verma
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
http://www.se.cuhk.edu.hk/~seem3570/12-pattern.pdf
here is the solution to this
On Wed, Aug 24, 2011 at 7:25 AM, keyankarthi keyankarthi1...@gmail.comwrote:
http://www.spoj.pl/problems/MAIN8_D/
i tried solving this problem
any ideas...??
for second test case 'htht'
the states i
thanks *Shashi* !!!
http://deepblue.lib.umich.edu/bitstream/2027.42/24435/1/708.pdf
this one is good to :)
On Wed, Aug 24, 2011 at 5:32 PM, shashi kant shashiski...@gmail.com wrote:
http://www.se.cuhk.edu.hk/~seem3570/12-pattern.pdf
here is the solution to this
On Wed, Aug 24,
^typo
On Wed, Aug 24, 2011 at 6:46 PM, keyan karthi keyankarthi1...@gmail.comwrote:
thanks *Shashi* !!!
http://deepblue.lib.umich.edu/bitstream/2027.42/24435/1/708.pdf
this one is good to :)
On Wed, Aug 24, 2011 at 5:32 PM, shashi kant shashiski...@gmail.comwrote:
http://www.spoj.pl/problems/MAIN8_D/
i tried solving this problem
any ideas...??
for second test case 'htht'
the states i considered are
1 T - (1/2) * x+1
2 HH - (1/4) * x+2
3 HTT - (1/8) * x+3
4 HTHH - (1/16) * x+4
5 HTHT - (1/16)(final state)
x is the expected no
http://www.spoj.pl/problems/MAIN8_D/
i tried solving this problem
any ideas...??
for second test case 'htht'
the states i considered are
1 T - (1/2) * x+1
2 HH - (1/4) * x+2
3 HTT - (1/8) * x+3
4 HTHH - (1/16) * x+4
5 HTHT - (1/16)(final state)
x is the expected no
any1??
On Sun, Aug 7, 2011 at 7:16 PM, Prakash D cegprak...@gmail.com wrote:
yeah, i also need to know the approach for this kind of problems asked in
many places
On Sun, Aug 7, 2011 at 3:58 PM, arvind kumar arvindk...@gmail.com wrote:
Hi
Can any1 pls help me in solving this?
Two
divide absolute speeds by their GCD..and then the answer is their relative
speed..
VM
NSIT, Dwarka
3rd year, COE
On , Prakash D cegprak...@gmail.com wrote:
any1??
On Sun, Aug 7, 2011 at 7:16 PM, Prakash D cegprak...@gmail.com wrote:
yeah, i also need to know the approach for this kind
this is my codeplz give me any test case where my code
fails.i am reaptedly getting WA
link is https://www.spoj.pl/problems/CENCRY/
# includecstdio
# includecstring
char a[]=aeiouaeiouaeiouaeioua;
char b[]=bcdfghjklmnpqrstvwxyz;
int search(char a1)
{
int i;
Hi
Can any1 pls help me in solving this?
Two persons are running on a circular track either in the same
direction or in the opposite direction, indefinitely. The speed of
both of them is given to you. Speed will be positive in clockwise
direction, and negative in anticlockwise direction. Print the
yeah, i also need to know the approach for this kind of problems asked in
many places
On Sun, Aug 7, 2011 at 3:58 PM, arvind kumar arvindk...@gmail.com wrote:
Hi
Can any1 pls help me in solving this?
Two persons are running on a circular track either in the same
direction or in the opposite
i attempted a problem
http://www.spoj.pl/problems/ABCD/
my logic is scan the input string and record the count of A, B, C, D in
array of size 4
now sort the count array
in the output array at first position put an element from count array
whose count is less than n and not equal to
hi everyone...i came across a quite simple problem on spoj...
https://www.spoj.pl/problems/LITE/
obvious solution will be O(n)...but it is getting TLE...
so we have to improve the complexity to O(logn)..can some suggest the
segment tree implementation of this problem
i am new to segment
www.spoj.pl/problems/SHOP
Its a pretty easy Q... But m not able to figure out any silly mistake
in my prog.. plzz help
#includeiostream
#includevector
#includemap
#includequeue
using namespace std;
char a[26][26];
int si, sj, di, dj, rows, cols;
void BFS(vector vectorint v, int si, int sj,
there's something called spoj forum, try posting it there
secondly, ask whether ur algo is right or wrong, not the code
On Sat, Jul 23, 2011 at 4:51 PM, KK kunalkapadi...@gmail.com wrote:
www.spoj.pl/problems/SHOP
Its a pretty easy Q... But m not able to figure out any silly mistake
in my
I agree with Shady on asking for algo for the problem but lets not be hard
on posting spoj question on spoj forum as these too involves algorithm (our
interest).
@KK : Can you tell us the judging status you are hitting? (Wrong answer,
timeout??).
~Viswanath.
On Sat, Jul 23, 2011 at 4:57 PM,
What will happen if r=di,c=dj in your safe function,I think that is causing
the error...
On Sat, Jul 23, 2011 at 8:29 PM, viswanath vellaiappan
viswanath.vellaiap...@gmail.com wrote:
I agree with Shady on asking for algo for the problem but lets not be hard
on posting spoj question on spoj
Does anyone know how to simplify the expression for this problem ?
https://www.spoj.pl/problems/EXFOR/ To get AC for this problem we can always
solve the expression, which is bruteforce, any other better way ?
Mathematician's way ?
--
You received this message because you are subscribed to the
It forms a pattern for each combination i solved it tht way in spoj.
On 7/24/11, shady sinv...@gmail.com wrote:
Does anyone know how to simplify the expression for this problem ?
https://www.spoj.pl/problems/EXFOR/ To get AC for this problem we can always
solve the expression, which is
I'm trying to solve this problem: www.spoj.pl/problems/TAILS
I tried of eliminating 1's from left to right and from right to left
and printed the minimum among them.
I got WA. Any other ideas to proceed this problem?
--
You received this message because you are subscribed to the Google Groups
Hi,
I am solving this http://www.spoj.pl/problems/DP/ problem using Djikstra's
algorithm. What is the dynamic programming solution to this ?
PS : Don't post the code, but the states of dp.
Thanks.
Shady
--
You received this message because you are subscribed to the Google Groups
Algorithm
http://www.spoj.pl/problems/GPA1/
hey guys here is my code and its given WA ...plzz tell me
where i am worng..i am tried getting WA in this question
# includestdio.h
# includestdlib.h
int main()
{
int n;
scanf(%d,n);
while(n--)
{
double a,b,c,d,e,f;
double
http://www.spoj.pl/problems/STRDIST/
Getting WA repeatedly. Can someone help me with the below code.
#include iostream
#include string
#include stdio.h
#include algorithm
using namespace std;
int main()
{
int k,l;
scanf(%d %d,k,l);
string str1 = ;
string str2
@ kartik sachan
Problem with this code is this-
All GB pairs should be process in one time period
On 6/23/11, kartik sachan kartik.sac...@gmail.com wrote:
QUESTION LINK IS http://www.spoj.pl/problems/SHLIGHTS/
MY CODE IS GIVEN BELOW
ITS IS GIVING TLEPLZZ HELP ME OUT
#
QUESTION LINK IS http://www.spoj.pl/problems/SHLIGHTS/
MY CODE IS GIVEN BELOW
ITS IS GIVING TLEPLZZ HELP ME OUT
# includecstdio
# includecstring
int main()
{
int t;
char a[17];
scanf(%d,t);
int i,j,k;
while(t--)
{
int count=0;
int flag=0,flag1=0;
I am getting WA for this problem.I dont know whether its case of overflow or
I have come up with a wrong formula, https://www.spoj.pl/problems/CHAIR/
I am coding in python so I dont think there is probblem of overflow.
def f(n):
if n0:
return 0
if n==0:
return 1
i=n
1 - 100 of 257 matches
Mail list logo