# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
380249 | rqi | Trol (COCI19_trol) | C++14 | 1 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll red(ll a){
if(a % 9 == 0) return 9;
return a % 9;
}
int main(){
int Q;
cin >> Q;
for(int i = 1; i <= Q; i++){
ll l, r;
cin >> l >> r;
ll ans = 0;
while(l % 9 != (r+1) % 9){
ans+=red(l);
l++;
}
ans+=(r-l+1)/9*45;
cout << ans << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |