# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975998 | vjudge1 | Trol (COCI19_trol) | C++17 | 1087 ms | 404 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 bil (int n){
while(n>=10){
int hasil=0;
while (n>0){
hasil+= n%10;
n/=10;
}
n= hasil;
}
return n;
}
int main(){
int q;
cin >> q;
for (int i=0; i<q; i++){
long long l, r;
long long sum=0;
cin >> l >> r;
for (int j=l; j<=r; j++){
sum+= bil(j);
}
cout << sum << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |