| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 4309 | 2260 | 2115 | 55.967% |
Given two non-negative integers $A$ and $B$, compute $A + B$.
You should implement the following procedure:
int sum(int A, int B)
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 20 | $A ≤ 10$; $B ≤ 10$ |
| 2 | 30 | $B = 0$ |
| 3 | 50 | No additional constraints. |
Consider the following call:
sum(1, 1)
In this case $A = B = 1$. Hence, the procedure should return $1 + 1 = 2$.
Consider the following call:
sum(2, 3)
In this case $A = 2$ and $B = 3$. The correct return value is $5$.
Input format:
A B
Output format:
R
Here, $R$ is the value returned by sum.
C++17, C++20, C++17 (Clang), C++20 (Clang)