# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976627 | vjudge1 | Trol (COCI19_trol) | C++17 | 1067 ms | 600 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;
int main()
{
int Q;
cin >> Q;
while(Q--)
{
long long count=0;
long long L, R;
cin >> L >> R;
for (long long i = L; i<=R; i++)
{
int hasil = 0;
if (i < 10)
{
hasil = i;
}
else if (i % 9 == 0)
{
hasil = 9;
}
else
{
hasil = (i % 9);
}
count += hasil;
}
cout << count << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |