Timus 1000. A+B Problem – Problem Solution & Logic
Almost every online judge has a “A+B” problem. The first problem (easiest) is often present to allow testing if online judges are working (of course they are!)
This problem can be found at Timus Online Judge.
Of course, almost every registered users will AC this simple problem after immediate registration, to boost their confidence.
This problem, is so simple, but don’t have so much details… for example, the range of inputs are unknown.
The Solution of the problem in C++ is :
#include
int main(){
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", a+b);
return 0;
}
3 comments
MH
Mahmud Hossain
July 16, 2026
Well written. Bookmarked this for my team's reference. Looking forward to more content like this.
SB
Sumaiya Begum
July 15, 2026
Does this approach also work for larger datasets? Our team is dealing with something similar at scale.
RK
Rafiq Khan
July 14, 2026
Really insightful article! This is one of the clearest explanations I've come across. The examples make it very easy to understand.
AD
AdminAdminJuly 14, 2026Thank you Rafiq! Glad it was helpful.
