# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1243469 | snowysmo | Trol (COCI19_trol) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
int main(){
int q; cin>>q;
while(q--){
ll l, r; cin>>l>>r;
l--;
ll a = (r/9)*45 + (r%9)*(r%9+1)/2;
ll b = (l/9)*45 + (l%9)*(l%9+1)/2;
cout<<a-b<<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |