Submission #596471

#TimeUsernameProblemLanguageResultExecution timeMemory
596471Hussein3600Trol (COCI19_trol)C++14
10 / 50
1086 ms300 KiB
#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 timeMemoryGrader output
Fetching results...