# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
903966 | vjudge1 | Trol (COCI19_trol) | C++17 | 1088 ms | 456 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(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int q;
cin >> q;
while(q--){
long long l, r;
cin >> l >> r;
long long res = 0;
for(long long i = l;i <= r;++i){
long long temp = i;
while(temp > 9){
long long sum = 0;
while(temp){
sum += temp % 10;
temp /= 10;
}
temp = sum;
}
res += temp;
}
cout << res << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |