Page 1 of 1

Posted: Tue Mar 12, 2002 2:49 pm
by huangry
Can you give me a set of Test Data of Problem 215? Thank you.

215 - Spreadsheet Calculator

Posted: Thu Sep 18, 2003 8:00 pm
by Dominik Michniewski
I try to solve this problem but I got WA a few times - could anyone help me and send some IO data ?
I use simple grammar to evaluate cells values and I loop in sheet until I can evaluate any cells. Is this algorithm wrong ?

Best rgards
DM

Posted: Sat Sep 20, 2003 5:29 am
by Red Scorpion

Code: Select all

input:
2 2
-A1+B1
5
-10+2
3-9
4 4
A0+A1 
A1-A3
 A3-A3
 -9
-10
20 
100-10  
100+99
-99 
990
299
-390+10
12
-199
-199+-99 
200 
4 4
A1--A2 
A2-A3
 A3-A3
 -9
-10
20 
100-10  
100+99
-99 
990
299
-390+10
12
-199
-199+-99 
200 

output:
        0     1    
A    -11    5
B      -8   -6

A0 = A0+A1
A1 = A1-A3

        0       1      2      3
A      9       9      0      -9 
B    -10    20     90   199
C    -99   990   299  -380
D     12  -199  -298   200
Sorry, dominik. Padding space in my output is wrong.

Good Luck. :lol: [/java]

Posted: Mon Sep 22, 2003 8:46 am
by Dominik Michniewski
Your input contains leading blanks, but statment says:

Code: Select all

No line of input contains leading blanks. No expression contains any embedded blanks. 
And output format should be (for unevaluated)
<cell_name>: <cell_formula>

However I got Accepted now :-) Maybe input contains spaces at start of formula - I don't know ... I found in my code some mistakes with signs of expressions.

Thanks Red Scorpion for help :-)

Best regards
DM

Posted: Tue Sep 23, 2003 7:34 am
by Red Scorpion
Oh, sorry Dominik.

I don't write the input-output carefully.
Congratulations you have got AC... :lol: :lol:

Posted: Tue Sep 23, 2003 7:55 am
by Dominik Michniewski
I'm happy too :-) because I got Acc on other related problem (196) too :-)
So you help me twice in one post :-) Congratulations !! :-)

Best regards
DM

Posted: Thu Mar 31, 2005 5:05 am
by cytmike
Can anybody give me so correct test inputs? I got about 20 WA already :cry: I'm so desperate now.

What I knoe is the inputs does not have + sign in the front, expression must begin with a letter and there are no two consecutive + or - signs.

Plz help!!!!!!!

215 WA?? (need solution for this input)

Posted: Mon Apr 17, 2006 3:45 am
by Dani Rodrigo
Hello!
I've received WA many times. :cry: :cry:
Anyone could write the correct output for this input, please.
The first case is problematic. Obviosly the result is 0, but it involucrates the same cell. Which is the correct interpretation?

Code: Select all

1 1
A0-A0
4 4
A1-A2+A3
A2
A3
6+B1
A3
5+7-8
6+A3-A2
B2+7-15+B1
1
2
3
4
C1-C3-C3-C3-15-C3
8
5
6
3 3
A1
A2
B0
B1
B2
C0
C1
C2
A0
3 3
A1
A2
B0
B1
B2
6
A1
C2
A1
6 6
1
A2
A0
C2
C4+C5+C2
B4-B3
2
A1
A1
A1
B0
B1
3
D5-C0+4
5+A2+B6-C0+E5
4
5
6
4
1
5
10
15
20
5
A2
A2
A2
A2
A3
6
B4
4
5
6
7
6 6
1
A2
A0
C2
C4+C5+C2
B4-B3
2
A1
A1
A1
B0
B1
3
D5-C0+4
5+A2+B5-C0+E5
4
5
6
4
1
5
10
15
20
5
A2
A2
A2
A2
A0
6
B4
4
5
6
7
0 0
My program returns:

Code: Select all

A0: A0-A0

       0     1     2     3
A:    10    10    10    10
B:    10     4     6     2
C:     1     2     3     4
D:   -29     8     5     6

A0: A1
A1: A2
A2: B0
B0: B1
B1: B2
B2: C0
C0: C1
C1: C2
C2: A0

       0     1     2
A:     6     6     6
B:     6     6     6
C:     6     6     6

A3: C2
A4: C4+C5+C2
C2: 5+A2+B6-C0+E5
E5: A3

       0     1     2     3     4     5
A:     1     1     1     5    16     1
B:     2     1     1     1     2     1
C:     3    21     5     4     5     6
D:     4     1     5    10    15    20
E:     5     1     1     1     1     1
F:     6     2     4     5     6     7

Thanks :D

Posted: Mon Apr 17, 2006 8:12 am
by sclo
Here's output from my AC program:

Code: Select all

A0: A0-A0

      0     1     2     3
A    10    10    10    10
B    10     4     6     2
C     1     2     3     4
D   -29     8     5     6

A0: A1
A1: A2
A2: B0
B0: B1
B1: B2
B2: C0
C0: C1
C1: C2
C2: A0

      0     1     2
A     6     6     6
B     6     6     6
C     6     6     6

A3: C2
A4: C4+C5+C2
C2: 5+A2+B6-C0+E5
E5: A3

      0     1     2     3     4     5
A     1     1     1     5    16     1
B     2     1     1     1     2     1
C     3    21     5     4     5     6
D     4     1     5    10    15    20
E     5     1     1     1     1     1
F     6     2     4     5     6     7

Do you see your error?