This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
int main() {
std::vector<long long> f = {0, 1, 3, 6, 10, 15}; // Prefix sum array
// Lambda function defined in main
auto getSum = [&](int l, int r) -> long long {
return f[r] - (l > 1 ? f[l - 1] : 0);
};
// Example usage
std::cout << getSum(2, 4) << std::endl; // Output: 9
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |