CF662D.International Olympiad
普及+/提高
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. Organizers always pick an abbreviation with non-empty string y that has never been used before. Among all such valid abbreviations they choose the shortest one and announce it to be the abbreviation of this year's competition.
For example, the first three Olympiads (years 1989, 1990 and 1991, respectively) received the abbreviations IAO'9, IAO'0 and IAO'1, while the competition in 2015 received an abbreviation IAO'15, as IAO'5 has been already used in 1995.
You are given a list of abbreviations. For each of them determine the year it stands for.
国际缩写奥林匹克竞赛(International Abbreviation Olympiad)自1989年起每年举办一次。每年的竞赛都会被赋予一个形如 IAO'y 的缩写,其中 y 表示当前年份末尾若干位连续的数字。组委会总是选择一个非空的字符串 y,且该 y 之前从未被使用过。在所有满足条件的合法缩写中,他们选择最短的一个,并将其宣布为当年竞赛的正式缩写。
例如,前三届奥林匹克竞赛(分别对应年份 1989、1990 和 1991)获得的缩写依次为 IAO'9、IAO'0 和 IAO'1;而 2015 年的竞赛则获得缩写 IAO'15,因为 IAO'5 已在 1995 年被使用过了。
现给你一份缩写列表,请对其中每一个缩写,判断它所对应的年份。
输入格式
The first line of the input contains a single integer n (1 ≤ n ≤ 1000) — the number of abbreviations to process.
Then n lines follow, each containing a single abbreviation. It's guaranteed that each abbreviation contains at most nine digits.
输入的第一行包含一个整数 n(1 ≤ n ≤ 1000)—— 表示需要处理的缩写词数量。
接下来有 n 行,每行包含一个缩写词。保证每个缩写词中最多包含九个数字。
输出格式
For each abbreviation given in the input, find the year of the corresponding Olympiad.
对于输入中给出的每个缩写,找出对应奥林匹克竞赛的年份。
输入输出样例
输入#1
5 IAO'15 IAO'2015 IAO'1 IAO'9 IAO'0
输出#1
2015 12015 1991 1989 1990
输入#2
4 IAO'9 IAO'99 IAO'999 IAO'9999
输出#2
1989 1999 2999 9999
输入解题思路,AI测评打分。不知道怎么写?