読者です 読者をやめる 読者になる 読者になる

JOI 2011-2012 予選第二問も解いた

Shakespeare で。

第一問は 5 個の整数が入力だったので微妙だと思って、N 個の入力が必要になるような問題を解いた。問題は こんなやつ

第一問に比べて詰めて書いたはずなのに長さが3倍ぐらいになってしまった。

solve joi 2011-2012 yo-t2.

Achilles, the number of teams.
Banquo, counts the number.
Claudio, first team.
Dionyza, second team.
Emilia, score of first team.
Fenton, score of second team.
Gertrude, stores points.
Hecate, stores points reversed.
Isabella, the number of matches.
John of Gaunt, points the first team will earn.
John of Lancaster, points the second team will earn.
Lady Macbeth, modified point.
Malcolm, counts the number.
Octavia, with the last result.
Pantino, remembers the point.
Shallow, have the rank.
The Abbot of Westminster, copy.
Romeo, talks with others.
Juliet, a Romeo's lover.
Desdemona, feeds lines to others.
Helen, returns with a carriage.

                         Act I: First Process.

                     Scene I: The Introductions.

[Enter Romeo and Desdemona]
Romeo:
        Thou art as fine as the sum of a pretty flower and a lovely
        smooth rich plum.
[Exit Desdemona]
[Enter Helen]
Romeo:
        Thou art as fine as the sum of Desdemona and the sum of a red
        rose and a flower.
[Exit Helen]
[Enter Achilles]
Romeo:
        Listen to your heart.
[Exit Achilles]
[Enter Isabella]
Romeo:
        Thou art as gentle as the quotient between the product of
        Achilles and the difference between Achilles and a father and
        a amazing brother.
[Exit Isabella]
[Enter Banquo]
Romeo:
        Thou art as embroidered as Achilles.

                    Scene II: The Initializations.

[Exeunt]
[Enter Juliet and Gertrude]
Gertrude:
        Thou art nothing!
        
Juliet:
        Remember me.
[Exit Gertrude]
[Enter Banquo]
Juliet:
        Thou art as honest as the difference between thyself and a
        moon. Are thou worse than a lamp?

Banquo:
        If not, let us return to scene II.

                 Scene III: The Termination of Act I.

[Exeunt]
[Enter Romeo and Banquo]
Romeo:
        Thou art as mighty as Isabella.

                       Act II: Process Matches.
        
                 Scene I: Input a Match and Process.

[Exeunt]
[Enter Romeo and Malcolm]
Romeo:
        Thou art as reddest as Achilles.
[Exit Malcolm]
[Enter Claudio]
Romeo:
        Listen to your heart.
[Exit Claudio]
[Enter Emilia]
Romeo:
        Listen to your heart.
[Exit Emilia]
[Enter Dionyza]
Romeo:
        Listen to your heart.
[Exit Dionyza]
[Enter Fenton]
Romeo:
        Listen to your heart.
[Exit Romeo]
[Enter Dionyza]
Dionyza:
        Am I better than you?

Fenton:
        If so, let us proceed to scene II.
        Am I better than you?

Dionyza:
        If so, let us proceed to scene III.
[Exeunt]
[Enter John of Gaunt and John of Lancaster]
John of Gaunt:
        Thou art as noble as a sky!

John of Lancaster:
        Thou art as peaceful as the town!
        We must proceed to scene IV.

                   Scene II: Dionyza beats Fenton.

[Exeunt]
[Enter John of Gaunt and John of Lancaster]
John of Gaunt:
        Thou art as good as zero.

John of Lancaster:
        Thou art as honest as the sum of a mistletoe and a proud town.
        We must proceed to scene IV.

                   Scene III: Fenton beats Dionyza.

[Exeunt]
[Enter John of Gaunt and John of Lancaster]
John of Gaunt:
        Thou art as trustworthy as the sum of a warm summer's day and
        a stone wall.

John of Lancaster:
        Thou art nothing.

                       Scene IV: Update Points.

[Exeunt]
[Enter Gertrude and Lady Macbeth]
Lady Macbeth:
        Recall your imminent death!
        
Gertrude:
        Thou art as disgusting as me.
[Exit Gertrude]
[Enter Malcolm]
Lady Macbeth:
        Are you as pretty as Claudio?

Malcolm:
        If so, let us proceed to scene V.

Lady Macbeth:
        Are you as smooth as Emilia?

Malcolm:
        If so, let us proceed to scene VI.
        We must proceed to scene VII.

                     Scene V: Claudio Get Points.

[Exeunt]
[Enter Lady Macbeth and John of Gaunt]
John of Gaunt:
        Thou art as healthy as the sum of thyself and me. We must
        proceed to scene VII.

                     Scene VI: Emilia Get Points.

[Exeunt]
[Enter Lady Macbeth and John of Lancaster]
John of Lancaster:
        Thou art as lovely as the sum of thyself and me.

                Scene VII: Hecate Get Modified Points.

[Exeunt]
[Enter Lady Macbeth and Hecate]
Lady Macbeth:
        Remember me.
[Exit Lady Macbeth]
[Enter Malcolm]
Hecate:
        Thou art as cursed as the difference between thyself and a
        thing. Are thou worse than a wind?

Malcolm:
        If not, let us return to scene IV.

Hecate:
        Thou art as noble as Achilles.

                     Scene VIII: Reverse Hecate.

[Exeunt]
[Enter Hecate and Lady Macbeth]
Lady Macbeth:
        Recall what you said.
        
Hecate:
        Thou art as mighty as me!
[Exit Hecate]
[Enter Gertrude]
Lady Macbeth:
        Remember me.
[Exit Lady Macbeth]
[Enter Malcolm]
Gertrude:
        Thou art as handsome as the difference between thyself and an
        uncle. Are thou worse than a son?

Malcolm:
        If not, let us return to scene VIII.
[Exit Gertrude]
[Enter Banquo]
Malcolm:
        Thou art as foul as the difference between thyself and a
        niece. Are thou worse than a sister?

Banquo:
        If not, let us return to scene I.

                      Act III: Calculate Ranks.

                          Scene I: Prepares.
        
[Exeunt]
[Enter Romeo and Banquo]
Romeo:
        Thou art as loving as Achilles.

                      Scene II: Push Points to Hecate.

[Exeunt]
[Enter Gertrude and Hecate]
Hecate:
        Recall the point!

Gertrude:
        Remember me.
[Exit Hecate]
[Enter Banquo]
Gertrude:
        Thou art as mighty as the difference between thyself and a
        nose. Are thou worse than a nephew?

Banquo:
        If not, let us return to scene II.

Gertrude:
        Thou art as loving as Achilles.

                     Scene III: Copy The Points.

[Exeunt]
[Enter Gertrude and Hecate]
Gertrude:
        Recall what I said!

Hecate:
        Remember me.
[Exit Gertrude]
[Enter The Abbot of Westminster]
Hecate:
        Remember me.
[Exit Hecate]
[Enter Banquo]
The Abbot of Westminster:
        Thou art as amazing as the difference between thyself and a
        mother. Are thou worse than a niece?

Banquo:
        If not, let us return to scene III.

The Abbot of Westminster:
        Thou art as blossoming as Achilles.

                    Scene IV: Actual Computation.

[Exeunt]
[Enter Gertrude and Shallow]
Gertrude:
        Thou art as rich as a squirrel.

Shallow:
        Recall the point you have.
[Exit Shallow]
[Enter Pantino]
Gertrude:
        Thou art as proud as me.
[Exit Pantino]
[Enter Malcolm]
Gertrude:
        Thou art as reddest as Achilles.

                       Scene V: Calculation.

[Exeunt]
[Enter Shallow and The Abbot of Westminster]
Shallow:
        Recall the point I will fight.

The Abbot of Westminster:
        Am I better than Pantino?

Shallow:
        If not, let us proceed to Scene VI.

The Abbot of Westminster:
        Thou art as embroidered as the sum of thyself and a purse.

                         Scene VI: Next Team.

[Exeunt]
[Enter The Abbot of Westminster and Hecate]
The Abbot of Westminster:
        Remember me.
[Exit Hecate]
[Enter Malcolm]
The Abbot of Westminster:
        Thou art as clearest as the difference between thyself and a
        lantern. Are thou worse than a horse?

Malcolm:
        If not, let us return to scene V.

The Abbot of Westminster:
        Thou art as bold as Achilles.

                           Scene VII: Restore.

[Exeunt]
[Enter Hecate and The Abbot of Westminster]
The Abbot of Westminster:
        Recall what I gave you.

Hecate:
        Remember me.
[Exit The Abbot of Westminster]
[Enter Malcolm]
Hecate:
        Thou art as cunning as the difference between thyself and a
        hamster. Are thou worse than a moon?

Malcolm:
        If not, let us return to scene VII.

                     Scene VIII: Store The Rank.

[Exeunt]
[Enter Shallow and Octavia]
Shallow:
        Remember me.
[Exit Shallow]
[Enter Banquo]
Octavia:
        Thou art as cute as the difference between thyself and a
        morning. Are thou worse than a hair?

Banquo:
        If not, let us return to scene IV.

                      Act IV: Output The Result.

                     Scene I: Prepare for Output.

[Exeunt]
[Enter Octavia and Banquo]
Octavia:
        Thou art as fair as Achilles.

                       Scene II: Actual Output.

[Exeunt]
[Enter Octavia and Romeo]
Romeo:
        Recall the rank! Open your heart!
[Exit Octavia]
[Enter Helen]
Romeo:
        Speak your mind!
[Exit Helen]
[Enter Desdemona]
Romeo:
        Speak your mind!
[Exit Desdemona]
[Enter Banquo]
Romeo:
        Thou art as fine as the difference between thyself and a
        fellow. Are thou worse than a door?

Banquo:
        If not, let us return to scene II.