Connection Status:
Competition Arena > Submission #9
System Testing
11 / 11
AC 11/11 test cases passed
Submission #9
ProblemNumReverseEasy
Handleburst-2
Submitted2026-07-05 07:57:42
Source Code
#include <string>
#include <algorithm>
using namespace std;

class NumReverseEasy {
public:
    long long getsum(int A, int B) {
        long long total = 0;
        for (int n = A; n <= B; n++) {
            string s = to_string(n);
            reverse(s.begin(), s.end());
            total += max((long long)n, (long long)stoll(s));
        }
        return total;
    }
};