#abc230a. A - AtCoder Quiz 3
A - AtCoder Quiz 3
Score : points
问题描述
AtCoder Grand Contest (AGC) 是一项具有世界权威的定期比赛,已经举办了54次。
正如你现在参加的第230次ABC被称作ABC230
一样,第N次AGC最初是以零填充的3位数字N来命名的。(例如:第1次AGC是AGC001
,第2次AGC是AGC002
,以此类推)
然而,最近的第54次AGC被称作AGC055
,其数字比54大一。由于社会状况导致AGC042
被取消并缺失,自第42次及以后的比赛,其编号都比实际举办的次数大一。(详见样例输入和输出的说明部分)
现在的问题是:给定一个整数N,请按照格式AGCXXX
打印第N次AGC的名字,其中XXX
是一个零填充的3位数字。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
AtCoder Grand Contest (AGC), a regularly held contest with a world authority, has been held times.
Just like the -th ABC ― the one you are in now ― is called ABC230
, the -th AGC is initially named with a zero-padded -digit number . (The -st AGC is AGC001
, the -nd AGC is AGC002
, ...)
However, the latest -th AGC is called AGC055
, where the number is one greater than . Because AGC042
is canceled and missing due to the social situation, the -th and subsequent contests are assigned numbers that are one greater than the numbers of contests held. (See also the explanations at Sample Inputs and Outputs.)
Here is the problem: given an integer , print the name of the -th AGC in the format AGCXXX
, where XXX
is the zero-padded -digit number.
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the name of the -th AGC in the specified format.
Sample Input 1
42
Sample Output 1
AGC043
As explained in Problem Statement, the -th and subsequent AGCs are assigned numbers that are one greater than the numbers of contests.
Thus, the -th AGC is named AGC043
.
Sample Input 2
19
Sample Output 2
AGC019
The -th and preceding AGCs are assigned numbers that are equal to the numbers of contests.
Thus, the answer is AGC019
.
Sample Input 3
1
Sample Output 3
AGC001
As mentioned in Problem Statement, the -st AGC is named AGC001
.
Be sure to pad the number with zeros into a -digit number.
Sample Input 4
50
Sample Output 4
AGC051
update @ 2024/3/10 10:02:41
相关
在下列比赛中: