No.3603 What Question Number Are We On?
問題文最終更新日: 2026-07-31 20:56:28
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 507 オムニバス
(順位表)
の他の問題:
Problem Statement
Yuuti is participating in a quiz contest. In this quiz contest, $Q$ questions are asked in order.
Answer each question in order. Each question is one of the following $2$ types.
- Type $1$: Integers $A$ and $B$ are given. Answer the value of $A+B$.
- Type $2$: Answer which question number the current question is.
Constraints
- All inputs are integers
- $1 \le Q \le 100$
- For questions of type $1$, $1 \le A, B \le 1000$
Input
$Q$ $query_1$ $query_2$ $\vdots$ $query_Q$
Here, $query_i$ represents the $i$-th question and is given in one of the following formats.
For type $1$
$1$ $A$ $B$
For type $2$
$2$
Output
Output $Q$ lines. On the $i(1 \le i \le Q)$-th line, output the answer to the $i$-th question.
Print a newline at the end.
Sample
Sample 1
Input
3 1 3 5 1 13 8 2
Output
8 21 3For question $1$, $3+5=8$, so output $8$.
Question $3$ is the $3$-rd question, so output $3$.
Sample 2
Input
5 2 2 2 2 2
Output
1 2 3 4 5
There may be cases where only questions of type $2$ are given.
Sample 3
Input
10 1 1 1 2 1 2 2 2 1 3 3 2 1 4 4 2 1 5 5 2
Output
2 2 4 4 6 6 8 8 10 10
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
UT0911