Submit solution
Points:
0.01 (partial)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Cho ~2~ số nguyên ~A~ và ~B~. Hãy tính ~A + B~.
Input
Gồm ~1~ dòng chứa ~2~ số nguyên ~A~ và ~B~ ~(1 \le A, B \le 1000)~, cách bởi ~1~ dấu cách.
Output
Ghi ra tổng ~A + B~.
Sample Input
3 4
Sample Output
7
Note
Gợi ý: Sử dụng toán tử "+".
Comments
.
+1 ban vote
+1 ban vote
nhờ bài lày mà mình đc 0,01 điểm.cảm ơn VNOI
valĩd
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Bài này cho 2 số A và B trên cùng một dòng. Hàm
input()
thì đọc hết nguyên một dòng luôn.Bạn có thể đọc input như sau:
xin 1 upvote
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
hay
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
uoc j
This comment is hidden due to too much negative feedback. Show it anyway.
công thức quy hoạch động khá đơn giản
include <bits/stdc++.h>
using namespace std; const int N = 1e3 + 1e2; int dp[N][N]; int main() { cin.tie(0)->syncwithstdio(0); dp[1][0] = 1; dp[0][1] = 1; for (int i = 1; i <= 1000; i++) { for (int j = 1; j <= 1000; j++) { dp[i][j] = max({dp[i - 1][j] - (-1), dp[i][j - 1] - (-1), dp[i - 1][j - 1] - (-2)}); } } int a, b; cin >> a >> b; cout << max(dp[a][b], dp[b][a]); return 0; }
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.