# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975558 | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 392 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 ll long long
using namespace std;
bool bad[105] = {};
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int Q;
ll L, R;
cin >> Q;
while (Q--) {
cin >> L >> R;
ll ans = (R/9) * 45 + ((R%9) * (R%9 + 1)) / 2;
if (L > 1) {
L--;
ans -= (L/9) * 45 + ((L%9) * (L%9 + 1)) / 2;
}
cout << ans << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |