# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251504 | MrRobot_28 | Trol (COCI19_trol) | C++17 | 1 ms | 384 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>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int q;
cin >> q;
while(q--)
{
int l, r;
cin >> l >> r;
int sum = 0;
sum += 45 * (r / 9);
while(r % 9 != 0)
{
sum += r % 9;
r--;
}
l--;
sum -= 45 * (l / 9);
while(l % 9 != 0)
{
sum -= l % 9;
l--;
}
cout << sum << "\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |