BoxOA #1
Counterfeit Currency
简单可在线判题
考点(AI 标注)字符串
A cryptocurrency transaction consists of n coins, each with a serial number. A valid serial number satisfies:
- Its length is 10 to 12 characters;
- The first 3 characters are distinct uppercase English letters;
- The next 4 characters give the minting year, which must be between 1900 and 2019 (inclusive);
- The following characters give the denomination, which must be one of 10, 20, 50, 100, 200, 500, 1000;
- The character right after the denomination is the last character of the serial number; the serial number must end with exactly one uppercase English letter.
A 1% fee is deducted from the total of this transaction, and no fractions are allowed, so the result is rounded down. Find the integer obtained after deducting the fee from the sum of the denominations of all valid coins.
输入格式
The first line contains n; each of the next n lines contains a serial number. 0<n≤100000, 1≤serial number length≤14, and serial numbers contain only English letters and digits.
输出格式
Output one integer: 99% of the total denomination of the valid coins, rounded down.
样例 1
输入:
8
AVG190420T
RTF20001000Z
QWER201850G
AFA199620E
ERT1947200T
RTY20202004
DRV1984500Y
ETB2010400G
输出:
1702
样例 2
输入:
1
ABC1999100X
输出:
99
样例 3
输入:
3
ABC199910A
ABD199910A
ABE199910A
输出:
29
样例说明
Example 1: the valid coins are AVG190420T (20), RTF20001000Z (1000), ERT1947200T (200), and DRV1984500Y (500), totaling 1720; after deducting 1% it is 1702.8, which rounds down to 1702. QWER201850G has an R in the year position; the first three letters of AFA199620E are not distinct; RTY20202004 has an out-of-range year and its last character is not an uppercase letter; ETB2010400G uses a 400 denomination, which does not exist. Example 2: 100×0.99=99. Example 3: three coins of 10 total 30, which is 29.7 after the fee, rounded down to 29.