# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976747 | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 348 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 jumlah(int x){
int ans=45*(x/9);
if(x%9!=0){
for(int i=x%9; i>0; i--){
ans+=i;
}
}
return ans;
}
int main(){
int Q,maks=0;
cin>>Q;
unsigned long long L[Q],R[Q];
for(int i=0; i<Q; i++){
int ans=0;
cin>>L[i]>>R[i];
cout<<jumlah(R[i])-jumlah(L[i]-1)<<endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |