Search found 8 matches

by Alim14
Sat Oct 11, 2014 5:46 pm
Forum: Volume 128 (12800-12899)
Topic: 12803 - Arithmetic Expressions
Replies: 7
Views: 1337

Re: 12803 - Arithmetic Expressions

brianfry713 wrote:You are losing precision converting a double to and from a string.
Try input:

Code: Select all

1
( ( 1000000.01 / 1000000.00 ) * 1000000.0 )
AC output:

Code: Select all

1000000.01
I solved it using a recursive descent parser where all intermediate values are kept as a double.
Thanks Brianfry, Got AC, Learned something new !! :D
by Alim14
Thu Oct 09, 2014 1:32 pm
Forum: Volume 128 (12800-12899)
Topic: 12803 - Arithmetic Expressions
Replies: 7
Views: 1337

Re: 12803 - Arithmetic Expressions

Don't round until you print the final result. Input: 1 ( ( 0.01 / 100.00 ) * 100.0 ) AC output: 0.01 Fixed this issue, but again WA :( /* Problem: 12803 - Arithmetic Expressions Algorithm: Stack */ #include<bits/stdc++.h> using namespace std; #define LL long long int main() { int i,j,k,n,m,d,test; ...
by Alim14
Mon Oct 06, 2014 2:21 pm
Forum: Volume 128 (12800-12899)
Topic: 12803 - Arithmetic Expressions
Replies: 7
Views: 1337

Re: 12803 - Arithmetic Expressions

WA again and again.Please help me to find my error or give me some test cases in which my code fails. /* Problem: 12803 - Arithmetic Expressions Algorithm: Stack */ #include<bits/stdc++.h> using namespace std; #define LL long long int main() { int i,j,k,n,m,d,test; scanf("%d",&test); getchar(); whil...
by Alim14
Sat May 17, 2014 4:36 am
Forum: Volume 4 (400-499)
Topic: 455 - Periodic Strings
Replies: 73
Views: 16828

Re: 455 - Periodic Strings

I am getting continuously WA. Please help to find out the error of my code. /* Algorithm: KMP */ #include<bits/stdc++.h> using namespace std; #define LL long long int lps[109]; void prefix_function(char *p) { int m=strlen(p+1); lps[1]=0; int q=0; for(int k=2;k<=m;k++) { while(q>0&&p[q+1]!=p[k]) q=lp...
by Alim14
Mon Feb 03, 2014 5:01 pm
Forum: Volume 8 (800-899)
Topic: 871 - Counting Cells in a Blob
Replies: 27
Views: 14607

Re: 871 - Counting Cells in a Blob

I am getting WA for missing 8 direction. Now AC :)
by Alim14
Sat Feb 01, 2014 8:10 pm
Forum: Volume 115 (11500-11599)
Topic: 11561 - Getting Gold
Replies: 31
Views: 9561

Re: 11561 - Getting Gold

Input:

Code: Select all

5 5
#####
GGGGG
TGTGT
GGGGG
GTGTP
Output:

Code: Select all

0
by Alim14
Sat Feb 01, 2014 8:07 pm
Forum: Volume 115 (11500-11599)
Topic: 11561 - Getting Gold
Replies: 31
Views: 9561

Re: 11561 - Getting Gold

When a player stands next to one or more trap, he sense a draft but as he don't know from where the draft comes,so he cant move from his position. This is the main challenge.
by Alim14
Sun Jan 05, 2014 4:02 pm
Forum: Volume 114 (11400-11499)
Topic: 11413 - Fill the Containers
Replies: 13
Views: 6664

Re: 11413 - Fill the Containers

Input:

Code: Select all

5 9
1 9 2 3 5
10 9
1 2 3 4 9 12 34 45 34 2

5 2
12 12 45 5 5
Output:

Code: Select all

9
45
55

Go to advanced search