# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1259845 | khaerulmamu | Trol (COCI19_trol) | C++20 | 1096 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main (){
int Q;
cin >> Q;
while (Q--){
ll l ,r;
cin >> l >> r;
ll dif = r-l+1;
int a=l%9;
ll ans=0;
for(int i=0; i<dif; i++){
ans+=a%9;
a++;
}
cout << ans <<endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |