# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596471 | Hussein3600 | Trol (COCI19_trol) | C++14 | 1086 ms | 300 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 mid (r+l)/2
#define fr(i,n) for(int i=0;i<n;i++)
typedef long long ll ;
ll ans=0 ;
int main()
{
int t ;
cin >> t ;
while(t--)
{
ll r , l ;
cin >> l >> r ;
for(int i=l;i<=r;i++)
{
ll x=i ;
while(x>0)
{
ans+=x%10;
x/=10 ;
}
}
cout<<ans<<endl;
ans=0 ;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |