TSSPC Contest 2 P2 - Grammar checker

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Joe is writing a formal essay for his English course. He wants you to write a program to calculate his final score. His teacher deducts 2 marks for an incorrect capitalization (first letter is capital, capital for letter after period, no capital otherwise) and incorrect punctuation (periods and commas must be followed by a space (except last), must end in a period). His teacher deducts contractions and personal pronouns by 1 mark and slang language is an instant 10 mark deduction.

Input Specification

The first line contains a single integer N, the amount of characters in Joe's essay. The next line contains Joe's essay. The length of the essay is at most 100 characters composed of words seperated by spaces, periods and commas (apostrophes work like normal characters).

The essay may contain contractions it's, can't, aren't, didn't, personal pronouns i, we, me, us, or slang language lol, yeet, sus, pog, orz, amongus.

Output Specification

Output Eric's final grade given the grade deductions (100 is the initial score).

If his grade drops below 50, output Fail

Sample Input 1

47
shakespeare is the .Greatest Writer alive .lol.

Sample Output 1

80

Explanation for Sample 1

Three incorrect capitalizations, two incorrect punctuations, one slang term. 100 - 6 - 4 - 10 = 80

Sample Input 2

53
i love playing amongus,it's the best game of ALL TIME

Sample Output 2

68

Explanation for Sample 2

Eight incorrect capitalizations, two incorrect punctuations, one contraction, one personal pronoun, one slang term. 100 - 16 - 4 - 1 - 1 - 10 = 68


Comments

There are no comments at the moment.