Submission #1124470

#TimeUsernameProblemLanguageResultExecution timeMemory
1124470doducanhTrol (COCI19_trol)C++20
50 / 50
1 ms328 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int t; main() { cin>>t; while(t--){ int l,r; cin>>l>>r; int res=(r-l+1); int tmp=res%9; res=((res/9)*45); int x=0; while(l>9){ while(l){ x+=(l%10); l/=10; } l=x; x=0; } x=l; while(tmp){ tmp--; res+=x; x++; if(x>9)x=1; } cout<<res<<"\n"; } return 0; }

Compilation message (stderr)

trol.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...