loj#P3233. 「POI2019 R1」Pisarze

「POI2019 R1」Pisarze

Description

Source Problem: POI XXVII - I etap (Pisarze)

Bytie encountered a text excerpt that certainly comes from one of the following three masterpieces of Polish literature:

  • “Pan Tadeusz” by Adam Mickiewicz,
  • “Quo Vadis” by Henryk Sienkiewicz,
  • “The Doll” by Bolesław Prus.

The issue is that he is not so certain which one it is. Help him out by writing a program that will determine the book the excerpt comes from.

Input Format

In the first input line, there is an integer TT specifying the number of test cases. Each of the following TT lines contains an excerpt from one of the three aforementioned books. The excerpt is stripped of Polish diacritics, contains between 1010 and 20002000 words, and both begins and ends with a complete word (or punctuation mark).

The total length of all the excerpts given on input will not exceed two million characters.

Output Format

Exactly TT lines should be printed to the standard output, the ii-th of which should contain a single word Mickiewicz, Prus, or Sienkiewicz, corresponding to the author of the ii-th input excerpt.

3
Petroniusz obudzil sie zaledwie kolo...
Litwo! Ojczyzno moja! ty jestes jak...
W poczatkach roku 1878, kiedy swiat...
Sienkiewicz
Mickiewicz
Prus

Grading

Attention: This is a data analysis task. There may be no ideal solution that correctly recognizes all excerpts.

The grading will be as follows:

  • Let TT be the number of excerpts on input.
  • Let PP be the number of correct answers given by contestant’s program.
  • If P0.9TP \geq 0.9 \cdot T, the contestant is awarded 100%100\% of the points for the test.
  • If PT3P \leq \frac T3 , the contestant is awarded 0%0\% of the points for the test.
  • Otherwise, the contestant is awarded 100PT30.9TT3100\cdot\frac{P-\frac T3}{0.9\cdot T-\frac T3} of the points for the test. All excerpts come from the files supplied with the task statement. Moreover, a program pistestgen.py is also supplied, which allows generating a random test with the command python3 pistestgen.py subtask name directory [seed], where:
    • subtask is the number of the test subset (an integer between 1 and 4),
    • name is the name of the test (the program will create files nazwa.in and nazwa.out),
    • directory is the path to the directory which containing the (texts of the) works,
    • seed is an optional parameter (a string of characters) which uniquely determines the output test, thus allowing generating the same test repeatedly.

This very program has been used to generate (all) test cases on which the contestants’ solutions will be evaluated.

Grading and Constraints

Subtask # Additional Constraints Score
11 T 100T \le 100, the excerpts contain between 500500 and 20002000 words 2020
22 T 1000T \le 1000, the excerpts consist of full sentences
33 T 1000T \le 1000, the excerpts contain between 3030 and 8080 words 3030
44 T 1000T \le 1000 3030