198 - Peter's Calculator

All about problems in Volume 1. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

198 - Peter's Calculator

Post by little joey »

Can someone give me the correct solution for the following input:

Code: Select all

a:=b+b
b:=5
PRINT a
RESET
a:=b-b
PRINT a
b:=a
PRINT a
a:=b+c
b:=5+d
c:=7-d
PRINT a
d:=-1
PRINT a
b:=c
c:=d
d:=b
a:=b-b
PRINT a
I can think of all sorts of answers ranging from UNDEF,UNDEF,UNDEF,UNDEF,UNDEF,UNDEF to 10,0,0,12,12,0 and any combination of the two. It just depends on how you define 'refers to' and 'cycle' and also if you're allowed to do symbol manipulation prior to checking them.

shuniu
New poster
Posts: 34
Joined: Thu Oct 16, 2003 6:15 pm

Post by shuniu »

The answer to that input should be 10,UNDEF,UNDEF,UNDEF,12,UNDEF. I highly doubt we need to do symbol manipulation prior to checking them.
I spend quite sometime on this problem, and im still getting WA.
Could someone post an AC output for the following input, Thanks!

Code: Select all

vuuY :=  60 *  20+  ( -949) 
Cs5c4 :=    95*   69-(  -563   ) +   13 + -196  *   69 +   -884  
gHW :=   ( -874  -  -137   *  54  +   50   )   *  ( C1 )*   -802 
Cs5c4 :=    -224*  25
C1 :=    (vuuY  )+   -16 
PRINT gHW
gHW := -716-(-362   ) *   (   (   66   )  )  
gHW := Cs5c4
C1 :=    (( 87 ) -17 )   - 10*   -492   
C1 := -863   
gHW :=   93 
PRINT gHW
PRINT vuuY
PRINT Aco
C1 :=   -446*   Aco   -( -288  )   
Aco :=   26 + -961  - -397 +-995   
gHW :=   (  34   )  +48   
C1 :=  (   62+   (  52  ))  
vuuY :=  (  -145   *   89)- -216  * ( gHW)-  ( -577)   
Aco := ( (( -395) -   (  (Cs5c4  )  ) +   -153  ) * -503) 
gHW :=  44 +   ( 26 ) - vuuY  - 52   *-939   
Cs5c4 :=  51
Aco := ( 7)  - -383   - -292 *(   (  0 ) ) *  gHW  
C1 :=  ( ( (-838)  *-106   --816+ 4   ) )
PRINT Aco
gHW :=   -351 *  ((   21  )   )   -(12)*  36+   -616 *   66-  ( 77) 
PRINT C1
Cs5c4 :=    (   ( ( -691  -( 89 )  *38  * 86 ) )-49 )+-883   
C1 := -977 +   29  
Cs5c4 := ( Aco- -142+-601) *46   -  14 
PRINT vuuY
Aco :=   ( Cs5c4   +   Cs5c4  +   -364   +  -697  -   74 )   * vuuY *  (  Cs5c4   )  
PRINT Aco
PRINT Aco
gHW :=  Cs5c4  *  95   
vuuY :=   -58   -  84-89   +  61*  -646  
PRINT Cs5c4
gHW := -123   *   (   -697   )  -   -277   +   95 
gHW :=   ((( -218  - (   78 )   )+  34  -   gHW  )  *(  32   )  *  4  )   +  -764  
PRINT C1
C1 :=  (   75   +vuuY- -848*-341  )   +   20   + 51
vuuY := -109 + -427
PRINT Cs5c4
C1 :=    ( -853   )  -1
PRINT C1
C1 :=   (  35  )
PRINT C1
Aco :=   -354  
PRINT C1
PRINT Aco
gHW :=  98   -15  *-895
PRINT Aco
PRINT gHW
C1 :=    3- (23 ) 
Aco :=    -466  + 95 +  gHW   * gHW -15  +  98  
RESET
vuuY :=   ( (9   )   )  +-412  
C1 := (  (  Cs5c4 -   ( 39 )   )  )*   99  +  85-  81 * -657* -965
PRINT gHW
PRINT Aco
gHW :=   53  +48 -  -699+ 64   * 20+ 20+  26 
Aco := (-599  )
PRINT gHW
vuuY :=  vuuY   
PRINT Aco
C1 :=   -66  -  70   
RESET
Cs5c4 :=   (  29 ) 
Cs5c4 :=  27   
Cs5c4 :=   -609 - 1  
Aco :=   (   Aco  *   C1   - Aco   )*-481   
gHW :=    (   -918   - ( -566)--921 )-   gHW
gHW := 66   
PRINT vuuY
PRINT Aco
vuuY :=   (  ((  -20  -   97  -  29  *-462  +   69  ) +  4) *34)  
PRINT gHW
Cs5c4 :=   -446* (( (  vuuY)  )   )  * -647 -   Aco
Cs5c4 :=   ((Aco   ) )   - 75  - 75   *   -531 -   66  +( (  (( -308   ))   )  ) 
Cs5c4 :=    -790   - C1 
gHW := (  51   -  31  -(   (31   ) )   +   87  ) +  -365  
Cs5c4 := (  -520-  -434   * 25   -   C1 *  52  +  22 +   90 )
PRINT Aco
Aco :=  -332   + ((Aco   ))*  85   +   -974   *  -2*   -151  --750  
vuuY :=   (  (  40*   62  )   -(  -274 )  +-729   -48 -   ( vuuY)  -  56 )   
PRINT Cs5c4
Aco :=    (gHW  +(   Aco  )  )   *Cs5c4  + -610  
PRINT Aco
PRINT Aco
PRINT C1
C1 :=    (   2  +   15 -83-78  *gHW -  41 )   +   -924   
gHW :=   -880   +   -953   - 44  +-27
Cs5c4 := ((  95   -36)  +-716)   *  -475 
Aco :=   -869 *   94-  -379  
PRINT Aco
PRINT C1
Cs5c4 :=    Cs5c4  -29   
PRINT vuuY
PRINT Cs5c4
vuuY := -584  
Cs5c4 :=  (50*-990   )
PRINT C1
PRINT Aco
gHW := (   -72 +  0 -  -444 -  57 )  -  Aco*  -17
C1 :=    -203-(   46)   
Aco :=   39 *vuuY-15  +  -965 
Aco :=    51 *  C1+  ( -930   ) 
PRINT Cs5c4
PRINT Aco
PRINT Aco
vuuY :=    (   34  -  (-924   )   *  (   -181)  ) -   -692  
PRINT gHW
PRINT C1
Aco :=    83  *  3  *80
PRINT vuuY
Aco :=    (98 -  (   20  )*vuuY   *-675 )   
PRINT vuuY
Cs5c4 :=  -691- Aco 
Aco :=  ( 55+  vuuY   + (Cs5c4  )  )-  56  -  -840 
C1 :=   -859*   74   +35+ 68+   97
PRINT vuuY
PRINT C1
C1 :=    -662   -  59
Cs5c4 :=  (   (( -858   *  51  ) -24*  (   26)   + (   -328 )   )+  vuuY*(-287  )   ) 
PRINT C1
gHW :=  33  - 65   
PRINT C1
C1 := -386* -635  
PRINT vuuY
PRINT vuuY
Cs5c4 := (   -594*   98  *  -606+ 28)
gHW :=    -886   * vuuY  +55  
PRINT C1
C1 := (48+   ( (C1  )))
PRINT C1
PRINT C1
PRINT Aco
C1 :=    59 *  -878+ Aco +   (   39   )  
gHW := 60-   -565   -  1+  -786 -  -407
C1 :=  -124 
PRINT vuuY
Aco :=    ( (   ( (  -424*   gHW  *68   ) )  ) -28 * -942  -  (-801 )-   -424 )
vuuY :=    (  (  52 *(   -326   ) *  -807 - (  Aco)  *  -639   -71) + vuuY  )   
PRINT Cs5c4
vuuY :=   83  
PRINT Cs5c4
PRINT Cs5c4
gHW :=  12*99 
C1 :=  -594 - 24   +  ((   C1   ))+-141 + 48   
PRINT C1
vuuY :=  (   (29   )* (90   )   )  
PRINT C1
PRINT vuuY
PRINT vuuY
gHW :=   -557 *  vuuY + gHW   
Aco :=  (  (   (  gHW +68   -  -946 * (  72  ) +  -609  )   * -914  )  )   + 43
Aco := (   2*   54-(   -851) - (   60) )   *   22 -99 
C1 :=   (   86  - -498+ -726   +-717-  -10) *(   65) 
PRINT Cs5c4
gHW := (  -725  )-  ( 91 )* -122   *( (   -620)) * Aco  
C1 :=   10   
PRINT vuuY
vuuY :=  -141  +20 + (6)  *   -804
vuuY :=    (  (  (   28-   -90 --390 )  +   16   )-   15) -  39  *   (   -116   )
Aco :=    -494  +(vuuY) - 96+   Aco   +   -560  *   51* gHW
PRINT vuuY
gHW := Aco  
PRINT C1
PRINT gHW
PRINT Aco
C1 :=   -833   
Cs5c4 :=   (  -360 )*-561 
gHW :=  -355   +  14
Aco := 46+87   - -251   -  19  
C1 :=   (   -383)  
PRINT Aco
Aco :=  66 - 37   --525  *  C1*97 + -147   
C1 :=   (( (   Cs5c4  )  +   (54  ))  *-46  +   ( 99  )  )  
Aco :=  ( (   68  + 29*C1   -  19   +  -370   * Aco   ) +  76) 
PRINT Aco
PRINT Aco
C1 :=    (96   ) *  -597   
Cs5c4 :=    (  Aco*vuuY *  C1+   -836- (  46  ) - -516--837  )  
vuuY := 88  
vuuY :=   ( -176+1   + 51  +   gHW  )  *(   (  (   21)  )  )+ Aco  
vuuY :=  ((  vuuY )+   gHW*  79   *   gHW - 31   +  33   -  16) 
PRINT Aco
PRINT vuuY
Cs5c4 := ((   (89  - -953 - 15  )  -   1   )*   72  *   90   ) 
PRINT gHW
Aco := -298 +  Cs5c4   * -714
Cs5c4 :=   ( -989   *  -177   - 63 +   82  )   
C1 := (   (   47  )  - -851  - -683  ) 
C1 :=  28 -(  83)   *   C1 
PRINT C1
PRINT gHW
PRINT Cs5c4
Cs5c4 :=  Cs5c4 +   5 
PRINT vuuY
C1 := 19  *Cs5c4   +85   -26-  11 +   35  
C1 := (   (( -696  +  (  40  )   - 42 +  -90-  C1 )  )  -  Aco  )   *   83  
Cs5c4 :=   C1*  -663   + 0 +  53   -  gHW 
gHW :=   41  -   -520
PRINT C1
Aco :=  (( -822  +  (   32   )   + C1 -  -414 ))  -   Aco
PRINT vuuY
PRINT Aco
Cs5c4 :=   -633 
gHW :=   (   ((  (Cs5c4 ) )   +   19  ) *  39  - vuuY   ) 
PRINT Aco
Aco := -452  +53*   -781 +   -12   
gHW :=  -311
Cs5c4 :=  89   +(   (-734  ))   +   7 -  -652  
PRINT Aco
PRINT Aco
PRINT vuuY
gHW :=  (   70  +   78  -  60 )-  91   
PRINT gHW
C1 :=   81 -80 
gHW :=   ( -521  )  -  C1
Cs5c4 := ( (  30  +  (  ( ( -755) )   )  ) )   
gHW := 53  
PRINT C1
gHW :=  (  ( -695* ( -334) +   -736   -38-8) )- 91
C1 :=    ((  ( (   -203 - 7   )+  -803  )))   
PRINT C1
PRINT Aco
PRINT Aco
PRINT Aco
Cs5c4 :=    82*   47  - -397  
PRINT Cs5c4
C1 :=    Cs5c4 - -243
gHW := -511  +  vuuY   -   62  -   C1   
Aco :=  ( ((  -681 -30  )   ) )   
Cs5c4 := (  gHW+  -108 *  17-54  )  +   -377
vuuY :=  9  +1  + Aco  +   ( -897   )
gHW :=  (   ( (   gHW --14  ) ) - (Aco  ))*   ( 9  ) +58   +  9
PRINT Aco
PRINT C1
PRINT C1
gHW := -141   -  (   -880  )*  97   + 37 +  -336 
gHW := 65  +  -418  
Cs5c4 :=    (  87  )  
PRINT Aco
gHW :=  46  +  49  *   30   *   -348   -  ( 25)  
C1 :=   -444   -47
PRINT gHW
Aco :=    -232   --635 +   1   *10 *57 *39*  (  (  -785 ) )
Aco :=   -704   + Aco +  -389   +  85-11*41  *   ( (  vuuY )   )   
Aco :=  ((-408*   Aco  )+-291  - -411) *-216
Cs5c4 :=  1   -  49  + -13- (  (  89   )  ) * gHW   +   31
PRINT Aco
vuuY :=    46*91
vuuY := C1   *  4 -   -415- 42   
PRINT C1
vuuY :=   vuuY  
vuuY :=    -25  *vuuY   +  C1  *   -596  
PRINT Aco
vuuY :=   ( -350)   +61  *   Aco  *   ( gHW )  -   42 
Cs5c4 :=  ((  30   ) ) +  (   (   (   Aco )   )  )  +   -596  *92  *  -293
Aco :=  (  ( ( -498  +  -201)   --367 -  -973+Cs5c4  )  + -961 +   -916 )  
C1 :=    17 
vuuY :=   ( (70+ -601   +   (  -850   )  )   *   C1   -   31  * 60 *   -554 ) 
PRINT Aco
PRINT C1
vuuY :=    (  85)   * C1   *   67   +   -586+  -868   - Aco   - 29 
PRINT Cs5c4
gHW :=   vuuY   + (86  )
Aco := 30   
Cs5c4 := Cs5c4  
PRINT Aco
C1 :=    (   -812  +  (   -197   )  ) -  18   *  -787
gHW :=    ( Cs5c4   )
PRINT Cs5c4
vuuY :=    ( -217 )  *  Cs5c4 + 98  
PRINT Aco
Aco :=   (C1 +  C1   )   *94
PRINT C1
PRINT Cs5c4
Cs5c4 :=    vuuY 
gHW :=  C1   * 35   -   66-   gHW   - 91* 87
PRINT vuuY
Aco := 72
gHW :=    8- 67 + 96 -  (   45) +   C1-55-29
Cs5c4 := (C1  +  -23  + -581 )*40  *-919  + Cs5c4   
C1 := (   90   +  -235  + 19+ -180   )   * C1   * (  67   )   
PRINT vuuY
vuuY := ((   -874)  + 52 *-78   )  
C1 :=    -113+   Cs5c4   +66+   vuuY *  (  14   ) *   61*   44
vuuY :=   46   -  -602 +  vuuY 
C1 := ( -268   )  +   vuuY
Cs5c4 :=  C1  
C1 :=   ( 38  )  
Cs5c4 :=   ( (  -134   )   )  +   90  *  -207 +   -217 *-751   - -389*   Cs5c4
PRINT gHW
PRINT C1
vuuY :=   -719  
Aco := (25)   + 72*  -391+39  *   -88   *-364  -( Cs5c4)
Cs5c4 :=  86  *   -816   *  -153+ -192   
vuuY :=  (   vuuY  *   47)  
C1 :=  60* -633+  -998*-42   +   53  
vuuY :=  24+   (   (  vuuY   )   )  
Cs5c4 :=    (   (  38   +   (  81   )*  (   82  )   *   10  ) -   -50   )  
PRINT vuuY
PRINT Cs5c4
C1 :=    ((   -983)   )   
C1 :=  (64 +   56-   65   *   C1  - 0   * -859   *67  )  
C1 :=   19  -  -353  
vuuY :=    98   *  70-37  
PRINT vuuY
C1 := -631-  59 *   20 + 58  
PRINT Cs5c4
vuuY :=   52 
PRINT Aco
Cs5c4 := -909 +  -63   
C1 :=    ( -640 )   --365- 12 -  -413-  15  *   36
PRINT Cs5c4
vuuY :=   -539   *   gHW
C1 := -259  
Aco :=   65 +   -609   +44  -vuuY -  Aco-   10
Aco := ((C1  )) +  35*gHW   +   21   +   31+   66   
PRINT C1
PRINT Aco
gHW := -397 +  35  *  76   
Cs5c4 :=  (  Aco   +   36  -  -807 *  -135  -  -871  )
PRINT Cs5c4
PRINT gHW
PRINT C1
C1 :=  30-  Aco   
gHW :=  vuuY   -   11
vuuY :=   vuuY   +  gHW 
C1 := (  4)+  -965
C1 := (   Cs5c4)   +16-  56
PRINT Cs5c4
PRINT Cs5c4
vuuY :=   -374+   59 *  (96  )  
vuuY :=    (-16   +-795 ) + 54 *  43   
Cs5c4 :=  (-377 ) *Aco  +  (  17   )+ 18 *   -660  - 11  -  -473   
gHW :=  -688 + ( 28 ) + -616- -737  
Aco := 75 
PRINT gHW
C1 :=    37  
C1 :=   ( -194 ) +   32 +vuuY   - -786 - 64-  10 
PRINT C1
PRINT gHW
gHW :=   12   
PRINT vuuY
C1 :=  (-650   +  gHW )-  ( 95  )  * -310*C1
PRINT C1
PRINT Aco
gHW :=   -523  -  3  
gHW := 6  --34   - -962   
PRINT C1
PRINT Aco
PRINT Cs5c4
vuuY :=    -588
C1 :=   83   *   ( -613 )  -  -22  *   -869 * C1   *13-   -118 
Aco :=    96  
PRINT vuuY
PRINT vuuY
gHW :=  ( -309  + -258-  -675   - -347) - (   19   ) +   93
C1 :=  ((  Aco *   -787  +Aco -   (  89)  ) +   48 + (   -623) -38  )  
PRINT gHW
PRINT gHW
gHW :=  -503   
Cs5c4 :=    (   (   12 ) -53   +-25   *32   - -49)  +23  
Cs5c4 :=    -137+  96   
PRINT Cs5c4
Cs5c4 := 3+32   *87   +-513
Aco := -781   +   vuuY+   (  85   )-  -952
PRINT gHW
vuuY := -469   *68- C1 
Cs5c4 :=  -436   -  22 *93   
PRINT Cs5c4
PRINT C1
vuuY :=   -485   -  (  -934)-  vuuY *   -238 +   ((  -759 ) ) - 84 +   (   77  )  
Aco :=    97 *-230 + -113 - (   (   93   )) 
PRINT vuuY
PRINT Cs5c4
Aco :=   (  -903 ) 
PRINT Cs5c4
PRINT vuuY
vuuY := 64   +-99--953 *  vuuY   +-110   * (  76 ) 
C1 :=  -801-   75  +   (   -909 )*  94 *  21   *  89*  -8 
PRINT C1
PRINT Cs5c4
PRINT Aco
PRINT C1
Cs5c4 :=  33 +   55   *  -606 + C1   --865 
vuuY := 73   + -299   -99- -650   *  5 + 66   
Aco := (C1  +  98   +   Aco   *89) + -659* (  -842   ) +   71
PRINT C1
Cs5c4 := (-41   -  11--392  )   +-378   -( -289  )  -  2  *   (  gHW  )  
PRINT C1
PRINT C1
Aco :=  (9 )-  -741 -  71 -(  12)  -  31   --202 + 11  
PRINT Aco
Aco :=  90
PRINT vuuY
PRINT gHW
PRINT Cs5c4
vuuY :=    -42  -   -19
Aco := 69  
Cs5c4 := (  12*  94 * -874  -   (( -487   )   )  )   
PRINT vuuY
gHW := -513-  (-654) + 96  -51  *(   -708 )+29   
PRINT C1
C1 :=   ( -165 + -738  + vuuY-  25   -  -600   -(   -806   ))*(   -32 )
PRINT C1
PRINT C1
C1 :=    (   ( ( -946 *   (  -434  )   +-670 ) ))   -vuuY   +   20  
PRINT Aco
C1 := ( (47 +   90   --588))   *(89  ) -( -762  )  
C1 :=   -206   +gHW  * -54   - 15
PRINT vuuY
PRINT vuuY
Cs5c4 :=   (   (   -188  - 33 )  )
Aco := (Cs5c4)  *-85 *  -90 -(-948)  *  (  36   )
C1 := ((  ( -255  ) * (  gHW)-  0 --640)  )   
PRINT Aco
C1 :=   (-777  -   78-   30   + -139 - -3  +  63   )  * 98  
gHW :=   (-811 )  + (  ( -703  ) )   
PRINT Aco
Aco :=   -906 *   -110   - -943  
C1 :=    -262  
vuuY :=   ( ( -435   )   )  -vuuY *  82  -   -281*  -30   
C1 := (  -561 -  -177   *9 )+  26   -  -352 
PRINT Aco
PRINT Aco
PRINT vuuY
PRINT Cs5c4
PRINT C1
Aco :=   -970   +   -356   
PRINT Aco
PRINT C1
PRINT vuuY
gHW :=   Cs5c4   *   ( -689   ) - ( gHW)
PRINT Cs5c4
C1 :=  86
Cs5c4 :=    4 + -775-17   *0 *   53--748 
PRINT gHW
Cs5c4 := (   vuuY *  19 -  67   ) 
Cs5c4 :=   -711
PRINT Aco
C1 :=  (  7   *  65 -  57  *  -920 - -195  )  
PRINT Aco
vuuY :=   gHW -  11   +  42 * 2   +  89   
PRINT gHW
Cs5c4 := -589  *  70*  -995
vuuY :=   -788  -   56 +  (  -523)  * Cs5c4  *-23+( 94) * Aco   
PRINT vuuY
Aco :=   78  -  -402   +-252*   (  -948 )   
gHW :=  -861-   (( (Aco)   )  )+   -819 
Aco :=   -148   -   -497+  6 +-586 -  (88   )
vuuY := (   (  96   )) 
vuuY :=  -350   *   -77   +   -26+34
PRINT gHW
PRINT vuuY
C1 :=    -50   - (gHW   )-Cs5c4
PRINT gHW
C1 :=    51+  93*  -272  -  vuuY 
Aco :=    (   16 -  ( ( 2) ))
Cs5c4 :=   (   60)   * Aco  -( -580  )   
C1 :=    (  92   )  -vuuY  *25   *39+-798
C1 := (   Aco*  (   -228)   ) 
vuuY :=  74 
Aco :=    -559
PRINT Cs5c4
Aco := 1   *58  + 83   *30
PRINT vuuY
PRINT C1
PRINT C1
vuuY := (-182  *4  +   Aco)
PRINT vuuY
PRINT vuuY
PRINT Aco
Cs5c4 :=   (   (  (   ( 39  )  --342)   + -983   * -364  ))   
Aco := ( -578   * (   36  )   ) +(-228)  + ( 9  ) 
PRINT vuuY
PRINT vuuY
PRINT gHW
Cs5c4 :=    (-739 +   (   Cs5c4 )*  -306 )   +   60 +80   -(  59  )   + 37   
gHW :=    (  53 )   
vuuY := -100
RESET
Aco :=   (  8+  20 )   +   (  62 ) -   gHW --404   
PRINT gHW
C1 := (  Cs5c4 )  --277  +  16 -   gHW * -399*   -83   
PRINT vuuY
Cs5c4 :=    -913  
PRINT Cs5c4
Aco := ( Cs5c4+   -842  -   -385  +   Aco )-  83   - gHW 
PRINT gHW
PRINT Aco
C1 :=    -260 *  ( 0   )   + vuuY  +   -801  *(  60 ) - (-737   )   
gHW :=   (  (   -287  -   (   60)-( gHW  ) +-686  --743)   )
PRINT Cs5c4
vuuY :=   (   (   -563  -  (-286   )   -  59 -  (   -341 )  ) + 89)   +vuuY  
PRINT vuuY
Cs5c4 := -58  -   52 
Cs5c4 :=    (-540  +  -192  ) +(   -500 )  +  (  97  ) 
PRINT gHW
PRINT gHW
PRINT vuuY
gHW :=   ((( 97 ) )   )
Aco := 50* C1  +   20 
Cs5c4 :=   48 -   94   +   (-728 )*   -995
vuuY := Aco
PRINT Aco
PRINT Aco
PRINT Cs5c4
C1 :=  (  ( (41-   12  *  80)  ))+ -21 -   (   -378 ) -Aco
PRINT Aco
PRINT Aco
Cs5c4 :=   ((  -871 -   ( vuuY  ) ) * -87)+  Cs5c4
PRINT C1
PRINT gHW
Cs5c4 :=    gHW  +   84   * 33-47   +-883-   17   - -977 
RESET
gHW :=  (-764 --228*   -443  +   -230  ) 
gHW :=  ((   96  + -186-(   -767  )+ Aco  -  Aco  )   )  
PRINT vuuY
vuuY :=    vuuY   -  Aco +  98  +   Aco 
gHW := ((   gHW  +  62  ) +-875 *   C1  --263 )*  -689 
Cs5c4 :=   -617 
PRINT vuuY
vuuY := (Aco   + -16   - Aco +  ( (   67 )  )*   -539   )   
Cs5c4 := C1   
gHW := -255  * -303 +(  -440) + -690
PRINT C1
Cs5c4 := (( Cs5c4 * -746  )  - 93   +-808  -   -834 )   
Cs5c4 := 67 --318  *-981  +58+   28+  C1-   -463  
PRINT C1
vuuY :=   -667+  77-   -401 -   21  * -349   
PRINT Aco
PRINT Cs5c4
C1 :=   -972
PRINT vuuY
Aco := 87   
gHW :=   (   -407*( 35   ))   
C1 :=   18  +   Aco*   -930 -  -813 * C1   * (  11  )-   96
Cs5c4 :=    -60   
gHW :=   (  -652 -   94*(  (98) )  -  (   ( Cs5c4 )  ) -vuuY   *-777  )   *  70   
Aco :=  ( (((  (   (( 54   ))   *-242) ))  )   - Aco   -   ( gHW   )- 21* -612  )  
C1 := -886  -  51   
Cs5c4 :=    -933 +21 * -507  
PRINT C1
PRINT gHW
gHW :=  -141   -  -66  *27  -16   - 54 -  -286
C1 :=   70  +-339  
vuuY :=  (  (   vuuY  + -724  ) *-120--380   ) *   -721  
Cs5c4 :=   ( -784  )  *  40  
PRINT C1
Cs5c4 :=  92*  59- -19  -  ( 48  ) -   (71  ) 
Cs5c4 :=  (   ( -473  )   *  -711  *  19  *46  -  -367   *  96)  
gHW :=   7   
PRINT gHW
PRINT Cs5c4
Aco :=   ( (  (( -243)* 13* -911   )  + 4*-167   )  * 19   )+Cs5c4 
Cs5c4 :=  (  78 *   -723   *31  *4)  +  86 
Aco := ( 97  + -229  -   C1  -(  (  Aco)  )  -   33   )   
C1 :=  (   Cs5c4)-  Cs5c4 -68  +   -63 
Aco := (   (   (  30 -43) )  *  39   -8  ) --22   * (  gHW)   +vuuY
C1 :=   -516 + 57 - -56   +Aco 
gHW :=    (29  )   *(   91   ) -   (( 23  )) +  63  *  (  -108  )  * 66
Aco :=    ((-171 - (   94 ) +   69   *44   +   -811   )+ -282 +  -167)
vuuY := -415  + 58+   gHW  - C1  
PRINT Cs5c4
C1 :=   (  (   5  -  (-416 ))  *   80  )+76  +   -777 * C1   
Cs5c4 :=    (((   46 ) *   -934 +  91 *  -751  --134 *   (   -976  )- -825 ))
C1 :=    -805  -  13  *  vuuY  
Cs5c4 := 28
PRINT Aco
vuuY :=  ( (12   ) - Cs5c4-  ( -218)-  73 )-   -969  
PRINT C1
PRINT Cs5c4
PRINT vuuY
PRINT Aco
vuuY :=   (61 +  97  )   * -489 +   ( (vuuY )  ) -   76   - 0   
vuuY :=    (  ( -733*   24   - ( Aco  ))*  -568  )   *81   -   ( C1  ) 
gHW :=   (  (  ( (  (   54  + gHW)   * (   ((C1   )  )  )   )+  -743  ))+ 84 -(-179   )  )  +-961   
PRINT vuuY
PRINT Aco
Aco :=  ( 36)   
Aco :=   (  52 )*   ( 34  ) * 69*(   (  -202  )   )*  vuuY   
vuuY :=   (   -107  + 0   *  -671  * (  -805   ))  *(  34)   
C1 :=    -557   *  78   +79   +  vuuY  
PRINT C1
PRINT Aco
PRINT vuuY
PRINT Cs5c4
gHW :=  (   (  -292 - 24   -  73   +  Cs5c4  +-149   * 72)  * (82  )   ) 
C1 := 67- -388 *-257 - -189
Cs5c4 :=   C1  *  ( (  gHW ))   *87  -vuuY  *  83 
C1 :=  ( Aco)   *   gHW   
vuuY :=   (   -497 *   Aco  * 94-  gHW) +   -608+ -759   *Cs5c4 
vuuY :=   (  ( 63   -  Aco   +-769 --848+ gHW   )*   Cs5c4* -554 ) 
Aco :=  -463  
PRINT Aco
PRINT gHW
Aco :=   -804
Aco :=  (   ((   (   0 +-861  * gHW   ))  +   -529   ) )   + vuuY  +(  (24   )   ) + 94
vuuY := (   -208   )-62
vuuY :=   (  ((( -482 +( 91   )   + C1 )   )*   Cs5c4 *(-253 ) )  * 95   ) -  -665 
PRINT gHW
PRINT gHW
PRINT C1
Cs5c4 := 96  +-85
Cs5c4 := 66   
RESET
PRINT C1
gHW :=   -392   *10  * 5-   ( Aco   )
vuuY := ( ( (   gHW   + -278   *  -470   ) -   -264+   -325   )*-521   *vuuY   ) 
PRINT Cs5c4
PRINT vuuY
PRINT gHW
Aco :=    (  Aco  )  -   ( ((  -977   )   )) +  19-   ((  Cs5c4 )   )+-234
Cs5c4 := (  ( ( ((  (-583 )   ) * (  82  )  ) -  Cs5c4  - (  27)) ) * -770)-  vuuY   +   23  
PRINT Aco
vuuY := (   ( -60   )  +-156 *7 -  ( -803)+(  C1   )) -  C1  
PRINT Cs5c4
PRINT Cs5c4
PRINT Aco
Cs5c4 :=   ( -536   -  gHW ) -   -706- C1   *  63  +-672 *   vuuY
Cs5c4 :=   ((   (  69  -C1 -   -422 *  vuuY))  *   -297 *( vuuY  ) )
PRINT vuuY
Aco := -140-   -822 *(   -125   )  *   35 
PRINT C1
gHW :=   (   70  --260 )- (  55 ) * C1  +87  
vuuY :=    ( Cs5c4   )-  gHW   *  -608  -   44 * ( -614   )   -   25  
PRINT Cs5c4
PRINT gHW
C1 :=    38 + 46
vuuY :=  (81 -  -925   --562   +  (  43   )-   27)   *  78   
vuuY :=    ((-184   --756) )  
gHW :=    (   -403   )
RESET
gHW :=   -283   +   42 --541 
Aco := (81 + (-32  )  +   94  -  (4   )  + 31 )  +   -287*  23 
Aco :=   -951  
PRINT vuuY
gHW :=    1 +   -808-  gHW   -   (   83   )  
Aco :=   (  Aco  )
PRINT C1
vuuY :=    22   -  0  +26   
PRINT Aco
vuuY :=    (   (-823 ) -  72*C1   -   16  )
vuuY :=  65 *49  
vuuY := gHW  * (   (   95) )  -  -824 
vuuY :=   (   gHW   + (-659  )+Cs5c4 -   (( (  57 )   )   )--857)  + -703   - -769   
Aco :=    ( (  -709)  --446 +   24 )  
gHW :=    -548
gHW :=   ((   gHW+-553   )  - 3- -676   )
C1 :=    (-352 )  +  -755 - vuuY   
vuuY :=   -134 -   -273   -  -240 -   (41 )   *   Aco   
PRINT Aco
PRINT gHW
PRINT gHW
PRINT Aco
Cs5c4 :=  (  2 + 8  * Aco) + 9   +   (  -113)  +48 
Aco := (41  )   *  -178*  85   +  84  +44*  -695  
PRINT vuuY
Cs5c4 :=   ( gHW   +  5)
PRINT gHW
gHW :=   ( -990+ 54  *96) 
PRINT C1
Cs5c4 :=  (   57  +(-227  )  -  Aco  ) -  22  +  49* (  26  )-41  
PRINT C1
vuuY :=  ( -932   )  
PRINT Aco
gHW :=   (( (  80   )   )-   gHW - 92 +  -764  ) 
PRINT vuuY
PRINT vuuY
vuuY :=    (( gHW   +   gHW) *  82*  56 + -874  )  -   49-  20  
PRINT C1
Aco :=   -345 * -131   +46   -(31 )   
vuuY :=   (  20*-45  *   99- (73  )   -   (  (   (   -355 )) )   *   87 )- -158
vuuY :=   (-633*  gHW   )+   50 + -192 + gHW - (   -946 ) 
gHW :=   (vuuY*( (gHW  ))  )  
PRINT Aco
gHW :=   -355 -  73*  2   + Aco +  11  +   Cs5c4  -  -507 
Cs5c4 := ( 2  )
gHW :=   10 *  49   
PRINT C1
PRINT Cs5c4
C1 :=    -363 * 81
PRINT Aco
vuuY := (  ( 78  *-370  )   -(  Cs5c4 )  )+3
C1 :=    68- 60 
PRINT vuuY
gHW :=  22   
Cs5c4 :=   (( ((84  *  84)   + 13+-328)   )   +-366)   
gHW :=   -199 
gHW :=  (((   44 )   )   *  (vuuY   )   )   --416 +gHW*  89 * ( 59 )   + 16
PRINT C1
PRINT C1
PRINT Cs5c4
Cs5c4 :=   (   17  *   (  -210 )-   51   )*  ( ( -749 )  )   *  84 +  Aco
gHW :=    66   
C1 := 71  
C1 :=    Aco - -324-  (  -61 ) *-529   +52  + 33  
Aco :=  (   C1) *  -813
C1 :=   ( (   -105*  ( 2)+   43 +   ( ( 11  ))*   78* 51)   +40)   
PRINT vuuY
PRINT Cs5c4
vuuY :=   (  (  Aco - gHW)+   gHW -   -906   )   +  ( Aco) -   -160  
PRINT Cs5c4
PRINT C1
Aco :=   (-131 +   -438 +69   )
Cs5c4 :=  39   - 61+   (39 ) 
Aco := ( 20   +64*   (-704 )   +   -871 +-276   )  
Cs5c4 := (  vuuY   )   * 30  +   (-942) -40- (  ( 22)  ) * Aco  
Cs5c4 :=  71* 37  
vuuY :=   Cs5c4 
gHW :=    (  (   -119  *   vuuY-  ((27)) + -151+  -873   ) ) 
PRINT Aco
PRINT Cs5c4
PRINT Aco
PRINT Cs5c4
gHW :=  ((  gHW   ) ) 
Cs5c4 := -233*   87*80   * 30   -   3  + (-121)  
PRINT gHW
Cs5c4 := ( (C1  -  ( -456)*   31 )*   C1+ -642   *   -104   )  --66   
C1 :=    ((  -144-   (-402)   ) -  ( -364   )   +73*82)   * 31   + 54 
Aco :=  (   59  +   11  -46 ) -   33  
vuuY :=   47*  56 - (( 33  ) )  *12  * -749   
PRINT Aco
PRINT vuuY
gHW := (  ( -911  )-97  +   -395)*   (  0  ) + C1   -   ( (  -136 ) )  +   15
PRINT Aco
PRINT C1
PRINT Aco
PRINT gHW
Aco := (  (85 * Cs5c4   )  )  + 81  *   -20 
gHW :=   ((( ( (   vuuY  -  Aco-(( -438 ) )   ))  ) )   )  
C1 := (   ( -950  ) ) -vuuY  -   Aco  -   49 *  63  
C1 :=  (( C1+  (   (   vuuY)  )+  69)   ) *(  (   -534  )  ) +  47+  -706-   -97   
PRINT Cs5c4
PRINT Aco
PRINT Cs5c4
Cs5c4 :=   92   +gHW   + 78
C1 := (  39  *(  (Aco ))  * (   -231  )-   (  (  vuuY   ) ) *45 )  - (   94)   
C1 :=    90   
Cs5c4 := (  11   ) 
PRINT Cs5c4
PRINT vuuY
Cs5c4 :=   (   -138  + (((47)   )   )   ) 
PRINT gHW
vuuY :=   (   -351 * 22  )  - 5 
vuuY :=   (  (   -554  )   + 93*44 )   +  -950-   -30* -761   +-669 
Aco := -775  
C1 :=   20  -   -563-  vuuY  
PRINT C1
C1 :=   ( ( (  gHW  )   +40  - (-62   )   )  )  *   13  *   (   68)
PRINT Cs5c4
vuuY :=  (  -16)   
vuuY :=   -111+  (   29)  * C1+  77
PRINT vuuY
Cs5c4 :=  (   -200-   -405  -88 )   
PRINT vuuY
gHW :=    (  (   -132 )   + ( 86  ) +  57  *15   +   97   - -360   )   
Cs5c4 := ( ( (   -9  ) *  vuuY   ))
C1 :=    -211  
PRINT Aco
PRINT Aco
Cs5c4 :=  (   2   )   -  -433   -42   + -695 
C1 :=    (Cs5c4   )   *  (C1   )  -   -773  
gHW := -931   *  -295 *   (  -325   ) 
Cs5c4 :=  (  (   91  ) *   -794  +  -945  *  Aco   +   C1   +  -714   + C1)   
PRINT Aco
Cs5c4 :=   ((   (   gHW))   * 85+  22)--63  *94  *Cs5c4  -  -88
Cs5c4 :=   -91  - (gHW   )   
C1 :=    ( -205   *  -730-  Cs5c4   * 35) * vuuY   *  gHW   -67 
vuuY :=    C1  +   -613+  -880   +-162  
Aco := 28*  vuuY 
gHW :=  Cs5c4   -   (  -390   )  
Cs5c4 :=  -232   
Cs5c4 := C1  
PRINT gHW
Cs5c4 :=   (   9   -  18  -1   + vuuY  +vuuY)   
Aco :=    (   80  *   48 *C1*-816 ) +6   * -905 
PRINT Cs5c4
PRINT C1
Cs5c4 :=   (-887 * Cs5c4 *   C1  )   -  -944 +   -40   
gHW :=   ( -757)  
gHW :=  ( -923  - 84   +   Aco   +96 )
vuuY :=  (( (   71   )   *   19) *  30  -Aco ) 
vuuY :=  -809-   26  
PRINT Cs5c4
PRINT gHW
PRINT Aco
PRINT C1
PRINT vuuY
Aco :=    (   Cs5c4 -  -652  )  *( ( vuuY)  ) 
C1 := (85-   -148  -  48  -   vuuY  ) *  46
C1 :=   (   (  65 ) )  +   -982+C1 
Aco :=  (   ( (  (   ( -715 * 64+62)   *44 ) ))   )+ 65   
Cs5c4 := 5  +  ( (-498 ) )  
PRINT C1
PRINT Aco
vuuY :=   44  +83  
PRINT gHW
Aco :=   30  -  -891   -71- C1  *  83   
C1 :=   (  -865   )   +(-28 )+  (   33)  -  -985   
C1 :=    (  (   (  (   ((vuuY * 20   )  * 2)   )* 53-   -92 )  )   )
Aco :=  28  +   -3  --806+ -974  -  ( C1  ) - -1-1   
PRINT gHW
C1 :=   (   vuuY   )   -  Aco  -  C1- (   (-210) ) *18
gHW := -5   - 73   *  -843  + 34  *-65   
Cs5c4 :=   (  6   - 73   ) *  67  - -621  * -767 
Cs5c4 := gHW  *  (-822   )-   80   +  -382   +  -457   
vuuY :=    -236   
vuuY :=    ((  vuuY )+  -12 *  gHW+   -521   )*  vuuY -   -837 -84
gHW :=  (  61*gHW   + -313-51-  -279  - Cs5c4-Aco )
Aco :=   35 * Aco  
Aco := 82* 50  
PRINT gHW
C1 :=   (   gHW*   -369 *  -782   )   *   (95 )  
Cs5c4 :=  (( -119  )   -(   -479)  -   -468  ) *  27  + -989
PRINT vuuY
vuuY :=   -275*   (   -173)  
PRINT C1
Aco :=  (   ( (  ( (  5  )   )  )   ) -   -380  )  - -378*  (   20) *  27
PRINT gHW
PRINT vuuY
vuuY :=  ( (  -816*  ( ( 83   )  ) -   gHW  )  *  -788  +  -697  )
Cs5c4 :=  -947-Aco   *-184 
Cs5c4 :=   -298 -   -694 +  Cs5c4   -Cs5c4 +  gHW 
Aco :=  (   -950 ) -   (41)  *  1 *28-   (   (20  )   ) 
gHW :=    (  -634   )  +-890
Aco :=    ((  ( 71) +   ( C1 )  * 93   ) ) 
vuuY :=    -131   +  -102+-966
PRINT vuuY
PRINT C1
PRINT Cs5c4
vuuY :=  -316
Cs5c4 :=    18+-328*C1+   -538+   Aco 
PRINT gHW
PRINT Cs5c4
C1 := -199  
Aco :=   (  (   Cs5c4*77   +  85 )*   14)-   55
PRINT C1
gHW :=   -232*90-   Cs5c4 -   (   -388)* -320  *  C1
gHW :=    (-381 +  29  *   74 ) +  -658+ 65 -  Aco   
Aco :=  (-117)   
PRINT Aco
PRINT gHW
C1 :=  ( (   -518 + 62 -(   -669) )  +   57  ) 
PRINT vuuY
Aco := (   gHW )-   92 *   -661
PRINT Aco
Cs5c4 :=    (   -173   )  
gHW :=  -709  -   91 
C1 := (  (   (   -397   +-884   ) -  (   -518   ) *-330   +   -696 +-156 )   )   + 63 
Cs5c4 :=    89 *   ( ( -666) ) 
Cs5c4 :=   ( 35   )   
PRINT vuuY
Cs5c4 := ( -755 * 27)   *  51  *  28   
RESET
C1 :=   (  (   -472  +  gHW+   -552  ) )   
PRINT gHW
PRINT Aco
Aco :=    90  *   -881  - -233   +-994 
Aco :=    (   ( C1) * -688  -   ( Cs5c4  ) *-403+  (Cs5c4   )-18   )  *  gHW 
Aco :=   -427*28 +   86  
PRINT C1
C1 :=    -2+-697  +  -449   -  Cs5c4  * -22 +  ( -916 )   
gHW :=    (35 -Aco -  -396  --235   +  87)  
Aco :=  (( 84) )
Aco :=  (   -775 )   - -517 -   -263   -  gHW   +(   97)
vuuY :=    gHW   +(  ( -793) )  -  34   *Cs5c4
Aco :=   ( (50   )-   gHW )-   -404  --703 --974  
PRINT vuuY
PRINT vuuY
PRINT C1
PRINT Cs5c4
gHW :=   ( 72 )
Cs5c4 := -629  
PRINT C1
PRINT Cs5c4
C1 :=    -561*-52 +   19 *   ( -697) +   C1  
C1 :=  (   -900*66) 
C1 :=    (   ( (   (-628  *  -578  +( 35)   - Cs5c4 +3  )  ) ) )+( -403   )+(  (   (   36   ))   )  
Aco :=   ((  -46   +  81   +(   62   ) )   +C1  -  (  73 ) )* 60  
gHW :=   77 
Aco :=  30 *  46 
PRINT vuuY
Cs5c4 :=    ( (   (  ( 99 +  ( vuuY)  * C1)-   Cs5c4   )  - (   -802)  - (  29)  *  46 )   )
Aco :=  ( ( (   (  -789 )   -   C1   )  +gHW   )  +33 )  
PRINT C1
Aco :=  ( 80 )   
Cs5c4 := -16 
C1 :=    49
PRINT vuuY
PRINT gHW
PRINT C1
Cs5c4 := 36 + 42 + -540
C1 :=   (   ( -623 + Aco+ -544)   *   27   )+   57 
gHW :=    78  *  -326+-832   +  -525
vuuY :=  55   + -531-( Cs5c4  ) +  ( 6 )   + 4+33   
C1 :=   50  
PRINT C1
PRINT Cs5c4
vuuY :=  86*  vuuY  +   vuuY  -   -664  -81*(-395  )*   52
gHW :=   ( (  Aco   )  +   1 +-779)  +39  -Aco   -  17  
PRINT Aco
PRINT Cs5c4
PRINT Cs5c4
gHW :=    gHW-  95 
RESET
C1 :=    ( Aco) + 4 +   C1
PRINT Cs5c4

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski »

My accepted solution produces:

Code: Select all

-1239001780
93
251
UNDEF
UNDEF
89648
-10496104
UNDEF
UNDEF
UNDEF
-948
UNDEF
-854
35
35
-354
-354
13523
UNDEF
UNDEF
2126
-599
UNDEF
UNDEF
66
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-81307
147481
UNDEF
UNDEF
147481
-81307
-49500
-13629
-13629
UNDEF
-249
-166518
-166518
-166518
-63366
-721
-721
-166518
-166518
245110
UNDEF
UNDEF
35110821
-166518
35276500
35276500
35276500
UNDEF
UNDEF
2610
2610
35276500
2610
5033
10
UNDEF
UNDEF
365
UNDEF
UNDEF
UNDEF
UNDEF
-341
UNDEF
-341
175072
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-41857
-41857
UNDEF
-3
1
-1013
-41857
-41857
-41857
4251
-711
UNDEF
UNDEF
-711
-511539
UNDEF
-491
UNDEF
UNDEF
17
UNDEF
30
UNDEF
30
13157
UNDEF
UNDEF
UNDEF
-54
38
UNDEF
66508
6823
66508
1154613
-972
-259
-12426
-28974
2263
-259
UNDEF
UNDEF
-539
2061
-539
1511
UNDEF
75
UNDEF
75
-39676
-588
-588
529
529
-41
-503
-2482
UNDEF
UNDEF
-2482
-2482
UNDEF
1277587716
-2482
-903
1277587716
1277587716
1277587716
1277587716
849
2991
-503
1257
-23
1277587716
-14560
-14560
69
-23
-23
-1656522
-1656522
100603
100603
UNDEF
-221
1410
-1326
1410
UNDEF
-221
UNDEF
-1326
-1326
UNDEF
UNDEF
-1361
26958
-1361
-32960
74
UNDEF
UNDEF
1820
1820
2548
-21755
-21755
19347
UNDEF
UNDEF
-913
UNDEF
UNDEF
-913
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
724314
UNDEF
UNDEF
UNDEF
97
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
7140
-937
UNDEF
-269
7
293964054
-6992770
1511
-15079
28
1098
1511
UNDEF
1511
-47005
-545320224
-3638
28
-463
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-239
UNDEF
UNDEF
-239
26684245
UNDEF
-26685352
-26685352
-650826
-932
-932
UNDEF
45210
307769
2
45210
-28859
8
8
6375
-192375690
192346833
192346833
43631
-46183
2627
-46183
2627
UNDEF
-9
299236
-9
204902
-9
205053
UNDEF
UNDEF
UNDEF
11
299236
309029
21494
-91
UNDEF
UNDEF
-775
-775
-775
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-835
UNDEF
-2010647
-2011558
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
47575
-1199
UNDEF
UNDEF
-1524
UNDEF
-199
-117
1289
-316
UNDEF
-316
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-629
20670
UNDEF
-172
77
49
50
-462
80
-462
-462
UNDEF
Happy hunting

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)

shuniu
New poster
Posts: 34
Joined: Thu Oct 16, 2003 6:15 pm

Post by shuniu »

Thanks DM. I see there are some differences in my output compared to your version. But I don't understand why mine is wrong. I extracted some parts of the input that caused the difference, could you post your AC output to these? Thanks Again!

Input 1:

Code: Select all

gHW := (   -72 +  0 -  -444 -  57 )  -  Aco*  -17 
C1 :=    -203-(   46)    
Aco :=   39 *vuuY-15  +  -965 
Aco :=    51 *  C1+  ( -930   ) 
PRINT Cs5c4 
PRINT Aco 
PRINT Aco 
vuuY :=    (   34  -  (-924   )   *  (   -181)  ) -   -692  
PRINT gHW 
Input 2:

Code: Select all

Aco :=   -970   +   -356    
PRINT Aco 
PRINT C1 
PRINT vuuY 
gHW :=   Cs5c4   *   ( -689   ) - ( gHW) 
PRINT Cs5c4 
C1 :=  86 
Cs5c4 :=    4 + -775-17   *0 *   53--748 
PRINT gHW 
Cs5c4 := (   vuuY *  19 -  67   ) 
Cs5c4 :=   -711 
PRINT Aco 
C1 :=  (  7   *  65 -  57  *  -920 - -195  )  
PRINT Aco 
vuuY :=   gHW -  11   +  42 * 2   +  89    
PRINT gHW 
Cs5c4 := -589  *  70*  -995 
vuuY :=   -788  -   56 +  (  -523)  * Cs5c4  *-23+( 94) * Aco    
PRINT vuuY 
Input 3:

Code: Select all

Aco :=    (   16 -  ( ( 2) )) 
Cs5c4 :=   (   60)   * Aco  -( -580  )    
C1 :=    (  92   )  -vuuY  *25   *39+-798 
C1 := (   Aco*  (   -228)   ) 
vuuY :=  74 
Aco :=    -559 
PRINT Cs5c4 
Aco := 1   *58  + 83   *30 
PRINT vuuY 
PRINT C1 
PRINT C1
Input 4:

Code: Select all

vuuY :=   -667+  77-   -401 -   21  * -349    
PRINT Aco 
PRINT Cs5c4 
C1 :=   -972 
PRINT vuuY 
Aco := 87    
gHW :=   (   -407*( 35   ))    
C1 :=   18  +   Aco*   -930 -  -813 * C1   * (  11  )-   96 
Cs5c4 :=    -60    
gHW :=   (  -652 -   94*(  (98) )  -  (   ( Cs5c4 )  ) -vuuY   *-777  )   *  70    
Aco :=  ( (((  (   (( 54   ))   *-242) ))  )   - Aco   -   ( gHW   )- 21* -612  )  
C1 := -886  -  51    
Cs5c4 :=    -933 +21 * -507  
PRINT C1 
PRINT gHW 
Input 5:

Code: Select all

gHW :=  ( -923  - 84   +   Aco   +96 ) 
vuuY :=  (( (   71   )   *   19) *  30  -Aco ) 
vuuY :=  -809-   26  
PRINT Cs5c4 
PRINT gHW 
PRINT Aco 
PRINT C1 
PRINT vuuY 
Aco :=    (   Cs5c4 -  -652  )  *( ( vuuY)  ) 
C1 := (85-   -148  -  48  -   vuuY  ) *  46 
C1 :=   (   (  65 ) )  +   -982+C1 
Aco :=  (   ( (  (   ( -715 * 64+62)   *44 ) ))   )+ 65    
Cs5c4 := 5  +  ( (-498 ) )  
PRINT C1 
PRINT Aco 
vuuY :=   44  +83  
PRINT gHW 
Aco :=   30  -  -891   -71- C1  *  83    
C1 :=   (  -865   )   +(-28 )+  (   33)  -  -985    
C1 :=    (  (   (  (   ((vuuY * 20   )  * 2)   )* 53-   -92 )  )   ) 
Aco :=  28  +   -3  --806+ -974  -  ( C1  ) - -1-1    
PRINT gHW 
Input 6:

Code: Select all

Aco := 82* 50  
PRINT gHW 
C1 :=   (   gHW*   -369 *  -782   )   *   (95 )  
Cs5c4 :=  (( -119  )   -(   -479)  -   -468  ) *  27  + -989 
PRINT vuuY 
vuuY :=   -275*   (   -173)  
PRINT C1 
Aco :=  (   ( (  ( (  5  )   )  )   ) -   -380  )  - -378*  (   20) *  27 
PRINT gHW 
PRINT vuuY 
vuuY :=  ( (  -816*  ( ( 83   )  ) -   gHW  )  *  -788  +  -697  ) 
Cs5c4 :=  -947-Aco   *-184 
Cs5c4 :=   -298 -   -694 +  Cs5c4   -Cs5c4 +  gHW 
Aco :=  (   -950 ) -   (41)  *  1 *28-   (   (20  )   ) 
gHW :=    (  -634   )  +-890 
Aco :=    ((  ( 71) +   ( C1 )  * 93   ) ) 
vuuY :=    -131   +  -102+-966 
PRINT vuuY 
PRINT C1 
PRINT Cs5c4 
vuuY :=  -316 
Cs5c4 :=    18+-328*C1+   -538+   Aco 
PRINT gHW 
PRINT Cs5c4 
Last edited by shuniu on Thu Jun 24, 2004 6:39 pm, edited 1 time in total.

shuniu
New poster
Posts: 34
Joined: Thu Oct 16, 2003 6:15 pm

Post by shuniu »

BTW, my WA output to these inputs are as follows. I believe DM's AC outputs all end with UNDEF for the 6 cases, but mine always ends with a number.

Output 1:

Code: Select all

UNDEF 
-13629 
-13629 
-231378 
Output 2:

Code: Select all

-1326 
UNDEF 
UNDEF 
UNDEF 
UNDEF 
-1326 
-1326 
UNDEF 
-445472878 
Output 3:

Code: Select all

-32960 
74 
-580944 
-580944 
Output 4:

Code: Select all

UNDEF 
UNDEF 
7140 
-937 
388464720 
Output 5:

Code: Select all

UNDEF 
UNDEF 
UNDEF 
UNDEF 
-835 
UNDEF 
-2010647 
-2011558 
-270386 
Output 6:

Code: Select all

UNDEF 
UNDEF 
UNDEF 
UNDEF 
47575 
-1199 
1172245720 
UNDEF 
-1524 
-599837705 
Last edited by shuniu on Thu Jun 24, 2004 8:20 pm, edited 1 time in total.

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

The output of my accepted program for all test cases is:
-1239001780
93
251
UNDEF
UNDEF
89648
-10496104
UNDEF
UNDEF
UNDEF
-948
UNDEF
-854
35
35
-354
-354
13523
UNDEF
UNDEF
2126
-599
UNDEF
UNDEF
66
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-81307
147481
UNDEF
UNDEF
147481
-81307
-49500
-13629
-13629
-231378
-249
-166518
-166518
-166518
-63366
-721
-721
-166518
-166518
245110
UNDEF
UNDEF
35110821
-166518
35276500
35276500
35276500
UNDEF
UNDEF
2610
2610
35276500
2610
5033
10
UNDEF
UNDEF
365
UNDEF
UNDEF
UNDEF
UNDEF
-341
UNDEF
-341
175072
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-41857
-41857
UNDEF
-3
1
-1013
-41857
-41857
-41857
4251
-711
UNDEF
UNDEF
-711
-511539
UNDEF
-491
UNDEF
UNDEF
17
UNDEF
30
UNDEF
30
13157
UNDEF
UNDEF
UNDEF
-54
38
UNDEF
66508
6823
66508
1154613
-972
-259
-12426
-28974
2263
-259
UNDEF
UNDEF
-539
2061
-539
1511
UNDEF
75
UNDEF
75
-39676
-588
-588
529
529
-41
-503
-2482
UNDEF
UNDEF
-2482
-2482
UNDEF
1277587716
-2482
-903
1277587716
1277587716
1277587716
1277587716
849
2991
-503
1257
-23
1277587716
-14560
-14560
69
-23
-23
-1656522
-1656522
100603
100603
UNDEF
-221
1410
-1326
1410
UNDEF
-221
UNDEF
-1326
-1326
UNDEF
-445472878
-1361
26958
-1361
-32960
74
-580944
-580944
1820
1820
2548
-21755
-21755
19347
UNDEF
UNDEF
-913
UNDEF
UNDEF
-913
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
724314
UNDEF
UNDEF
UNDEF
97
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
7140
-937
388464720
-269
7
293964054
-6992770
1511
-15079
28
1098
1511
UNDEF
1511
-47005
-545320224
-3638
28
-463
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-239
UNDEF
UNDEF
-239
26684245
UNDEF
-26685352
-26685352
-650826
-932
-932
UNDEF
45210
307769
2
45210
-28859
8
8
6375
-192375690
192346833
192346833
43631
-46183
2627
-46183
2627
UNDEF
-9
299236
-9
204902
-9
205053
UNDEF
UNDEF
UNDEF
11
299236
309029
21494
-91
UNDEF
UNDEF
-775
-775
-775
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-835
UNDEF
-2010647
-2011558
-270386
UNDEF
UNDEF
UNDEF
UNDEF
47575
-1199
1172245720
UNDEF
-1524
-599837705
-199
-117
1289
-316
UNDEF
-316
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-15902
-629
20670
UNDEF
-172
77
49
50
-462
80
-462
-462
UNDEF

And I get the same results as shuniu on the other test cases.

shuniu
New poster
Posts: 34
Joined: Thu Oct 16, 2003 6:15 pm

Post by shuniu »

Thank you all! I get AC now.
My program was actually processing the inputs correctly, but there was a problem on reading the input.
Originally I thought I would stop when I reach an empty line, but it turned out empty lines are valid inputs too! Should have continued until hitting end of file.
I got tricked by this part:
line = [ assignment | print | reset ] <CR>.

kronenthaler
New poster
Posts: 3
Joined: Tue Oct 26, 2004 9:09 pm

Compiler error

Post by kronenthaler »

Hi, I need help
i try to solve Peter's calculator (198), but i receive a compiler error.

Here are the compiler error messages:

gcj: Internal compiler error: program jc1 got fatal signal 11

i compile in linux red hat 9, and no problems

the code is this:

import java.io.*;
import java.util.*;

class Main{
Main left,right;
String root;

Hashtable ht;
Hashtable bools;
int index=0;

Main(String r){
root=r;left=right=null;
}

Main(String r,Main l,Main _r){
root=r;left=l;right=_r;
}

long eval(Main t) throws Exception{
if(isLeaf(t)){
try{
long i=Long.parseLong(t.root);
return i;
}catch(Exception e){
Boolean b=(Boolean)bools.get(t.root);
if(b==null || !b.booleanValue()){
bools.put(t.root, new Boolean(true));
long ret=eval((Main)ht.get(t.root));
bools.put(t.root, new Boolean(false));
return ret;
}else{
throw new Exception();
}
}
}
String op=t.root;
if(op.equals("*")){
return eval(t.left)*eval(t.right);
}else if(op.equals("-")){
return eval(t.left)-eval(t.right);
}else if(op.equals("+")){
return eval(t.left)+eval(t.right);
}
return 0;
}

boolean isLeaf(Main t){
return (t.right==null && t.left==null);
}

public static void main(String argv[]){
Main m=new Main("");
m.begin();
}

void begin(){
try{
String line;
InputStream in=System.in;//new FileInputStream("new.in");
ht=new Hashtable();
while(!(line=readLine(in)).equals("")){
if(line.startsWith("PRINT")){
bools=new Hashtable();
StringTokenizer strT=new StringTokenizer(line," ");
strT.nextToken();
String nombre=strT.nextToken();
try{
bools.put(nombre,new Boolean(true));
System.out.println(eval((Main)ht.get(nombre)));
}catch(Exception e){
System.out.println("UNDEF");
// e.printStackTrace();
}
bools.put(nombre,new Boolean(false));
}else if(line.startsWith("RESET")){
ht=new Hashtable();
}else{
String nombre="";
line=line.trim();
int i=0;
while(line.charAt(i)!=' ') nombre+=line.charAt(i++);
while(i<line.length() && line.charAt(i)!=' ') i++;
i+=3;//sacar ':= '
while(i<line.length() && line.charAt(i)!=' ') i++;
index=0;
Main arbol=expresion(line.substring(i).trim());
//System.out.println("Pre: "+preOrden(arbol));
ht.put(nombre,arbol);
}
}
}catch(Exception e){
}
}

Main term(String line){
Main l=factor(line);
while(index<line.length() && line.charAt(index)=='*'){
String op=""+line.charAt(index);
index++;
while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
Main r=factor(line);
l=new Main(op,l,r);
}
return l;
}

Main factor(String line){
Main ret;
if(line.charAt(index)=='('){
index++;
while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
ret=expresion(line);
while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
if(line.charAt(index)==')'){
index++;
while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
}
}else{
String leaf="";
if(line.charAt(index)=='-'){
while(index<line.length() && line.charAt(index)!=' ' &&
line.charAt(index)!='*' && line.charAt(index)!='+' &&
line.charAt(index)!='(' && line.charAt(index)!=')'){
leaf+=line.charAt(index++);
}
}else{
while(index<line.length() && line.charAt(index)!=' ' &&
line.charAt(index)!='*' && line.charAt(index)!='+' && line.charAt(index)!='-' &&
line.charAt(index)!='(' && line.charAt(index)!=')'){
leaf+=line.charAt(index++);
}
}
if(leaf.equals("")){
leaf="0";
}

while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
ret=new Main(leaf);
}
return ret;
}

Main expresion(String line){
Main l=term(line);
while(index<line.length() && (line.charAt(index)=='+' || line.charAt(index)=='-')){
String op=""+line.charAt(index);
index++;
while(index<line.length() && line.charAt(index)==' ') index++; //skip blanks
Main r=term(line);
l=new Main(op,l,r);
}
return l;
}

String preOrden(Main t){
if(t!=null){
return t.root+"."+preOrden(t.left)+preOrden(t.right);
}
return "";
}

String readLine(InputStream in) throws Exception{
StringBuffer ret=new StringBuffer();
int c;
while((c=in.read())>0 && c!=(char)'\n') ret=ret.append((char)c);
return ret.toString();
}
}


Please someone to help me!!!!

Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

same problem

Post by Sedefcho »

I have the same error message while I am trying to solve
problem 10815. I also use JAVA.

I have 3-4 classes defined in the same file.
All of them are default classes ( without any modifier like
private protected or public ).

Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

Post by Sedefcho »

I have the feeling that the problem is related to the following
situation :

Class A references Class B / in A's code /

and

Class B references Class A / in B's code /


This is just a guess of mine of course. I have downloaded
JDK 1.1.8 and the javac compiler from JDK 1.1.8 has no problems
compiling my file.

Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

Post by Sedefcho »


fh
Learning poster
Posts: 59
Joined: Wed Jan 19, 2005 3:24 pm
Location: Jakarta
Contact:

some of the shuniu's sample input are overflow

Post by fh »

I got the same output with Adrian Kuegel except for cases that resulting an overflow. Since I got Accepted, it means that the Judge data doesn't have input that causes overflow (outside int). My output for shuniu's input:

-1239001780
93
251
UNDEF
UNDEF
89648
-10496104
UNDEF
UNDEF
UNDEF
-948
UNDEF
-854
35
35
-354
-354
13523
UNDEF
UNDEF
2126
-599
UNDEF
UNDEF
66
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-81307
147481
UNDEF
UNDEF
147481
-81307
-49500
-13629
-13629
-231378
-249
-166518
-166518
-166518
-63366
-721
-721
-166518
-166518
245110
UNDEF
UNDEF
35110821
-166518
35276500
35276500
35276500
UNDEF
UNDEF
2610
2610
35276500
2610
5033
10
UNDEF
UNDEF
365
UNDEF
UNDEF
UNDEF
UNDEF
-341
UNDEF
-341
175072
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-41857
-41857
UNDEF
-3
1
-1013
-41857
-41857
-41857
4251
-711
UNDEF
UNDEF
-711
-511539
UNDEF
-491
UNDEF
UNDEF
17
UNDEF
30
UNDEF
30
13157
UNDEF
UNDEF
UNDEF
-54
38
UNDEF
66508
6823
66508
1154613
-972
-259
-12426
-28974
2263
-259
UNDEF
UNDEF
-539
2061
-539
1511
UNDEF
75
UNDEF
75
-39676
-588
-588
529
529
-41
-503
-2482
UNDEF
UNDEF
-2482
-2482
UNDEF
1277587716
-2482
-903
1277587716
1277587716
1277587716
1277587716
849
2991
-503
1257
-23
1277587716
-14560
-14560
69
-23
-23
-1656522
-1656522
100603
100603
UNDEF
-221
1410
-1326
1410
UNDEF
-221
UNDEF
-1326
-1326
UNDEF
493475766162
-1361
26958
-1361
-32960
74
-580944
-580944
1820
1820
2548
-21755
-21755
19347
UNDEF
UNDEF
-913
UNDEF
UNDEF
-913
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
724314
UNDEF
UNDEF
UNDEF
97
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
7140
-937
388464720
-269
7
293964054
-6992770
1511
-15079
28
1098
1511
UNDEF
1511
-47005
89648992992
-3638
28
-463
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-239
UNDEF
UNDEF
-239
26684245
UNDEF
-26685352
-26685352
-650826
-932
-932
UNDEF
45210
307769
2
45210
-28859
8
8
6375
-192375690
192346833
192346833
43631
-46183
2627
-46183
2627
UNDEF
-9
299236
-9
204902
-9
205053
UNDEF
UNDEF
UNDEF
11
299236
309029
21494
-91
UNDEF
UNDEF
-775
-775
-775
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-835
UNDEF
-2010647
-2011558
-270386
UNDEF
UNDEF
UNDEF
UNDEF
47575
-1199
-41777427240
UNDEF
-1524
9817695400951
-199
-117
1289
-316
UNDEF
-316
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
UNDEF
-15902
-629
20670
UNDEF
-172
77
49
50
-462
80
-462
-462
UNDEF
Visit my script to hunt UVA problem here:
http://felix-halim.net/uva/hunting/
-----------------------
Felix Halim

Post Reply

Return to “Volume 1 (100-199)”