215  Spreadsheet Calculator
Moderator: Board moderators

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
215  Spreadsheet Calculator
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
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
If you really want to get Accepted, try to think about possible, and after that  about impossible ... and you'll get, what you want ....
Born from ashes  restarting counter of problems (800+ solved problems)
Born from ashes  restarting counter of problems (800+ solved problems)

 Experienced poster
 Posts: 192
 Joined: Sat Nov 30, 2002 5:14 am
Code: Select all
input:
2 2
A1+B1
5
10+2
39
4 4
A0+A1
A1A3
A3A3
9
10
20
10010
100+99
99
990
299
390+10
12
199
199+99
200
4 4
A1A2
A2A3
A3A3
9
10
20
10010
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 = A1A3
0 1 2 3
A 9 9 0 9
B 10 20 90 199
C 99 990 299 380
D 12 199 298 200
Good Luck. [/java]

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
Your input contains leading blanks, but statment says:
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
Code: Select all
No line of input contains leading blanks. No expression contains any embedded blanks.
<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
If you really want to get Accepted, try to think about possible, and after that  about impossible ... and you'll get, what you want ....
Born from ashes  restarting counter of problems (800+ solved problems)
Born from ashes  restarting counter of problems (800+ solved problems)

 Experienced poster
 Posts: 192
 Joined: Sat Nov 30, 2002 5:14 am

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
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
So you help me twice in one post Congratulations !!
Best regards
DM
If you really want to get Accepted, try to think about possible, and after that  about impossible ... and you'll get, what you want ....
Born from ashes  restarting counter of problems (800+ solved problems)
Born from ashes  restarting counter of problems (800+ solved problems)

 New poster
 Posts: 11
 Joined: Sun Jul 18, 2004 1:39 am
215 WA?? (need solution for this input)
Hello!
I've received WA many times.
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?
My program returns:
Thanks
I've received WA many times.
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
A0A0
4 4
A1A2+A3
A2
A3
6+B1
A3
5+78
6+A3A2
B2+715+B1
1
2
3
4
C1C3C3C315C3
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
B4B3
2
A1
A1
A1
B0
B1
3
D5C0+4
5+A2+B6C0+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
B4B3
2
A1
A1
A1
B0
B1
3
D5C0+4
5+A2+B5C0+E5
4
5
6
4
1
5
10
15
20
5
A2
A2
A2
A2
A0
6
B4
4
5
6
7
0 0
Code: Select all
A0: A0A0
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+B6C0+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
Here's output from my AC program:
Do you see your error?
Code: Select all
A0: A0A0
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+B6C0+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