| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 977194 | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 348 KiB | 
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 <bits/stdc++.h>
#define int long long
using namespace std;
int calc(int n){
    int a = n % 9;
    return (n / 9) * 45 + ((a * a + a) / 2);
}
int f(int a, int b){
    return calc(b) - calc(a - 1);
}
signed main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while(t--){
        int a, b; cin >> a >> b;
        cout << f(a, b) << endl;
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
