# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465905 | JasperL | Trol (COCI19_trol) | C++14 | 1 ms | 204 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 <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int q;
vector<ll> ret;
ll get(ll x) {
ll b = x / 9;
ll res = 45 * b;
for (ll i = 0; i <= x%9; i++) res += i;
return res;
}
int main() {
cin >> q;
for (int i = 0; i < q; i++) {
ll l, r; cin >> l >> r;
ret.push_back(get(r)-get(l-1));
}
for (ll z : ret) cout << z << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |