Submission #338931

#TimeUsernameProblemLanguageResultExecution timeMemory
338931A_DTrol (COCI19_trol)C++14
30 / 50
1 ms364 KiB
#include <bits/stdc++.h> #define ll long long #define F first #define S second using namespace std; ll f(int v) { if(v==0)return 0; ll k=v/9; ll ret=k*(9*10)/2; v%=9; ret+=v*(v+1)/2; return ret; } main() { int q; cin>>q; while(q--) { ll l,r; cin>>l>>r; cout<<f(r)-f(l-1)<<endl; } }

Compilation message (stderr)

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