| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1300709 | ar_tkinter | Trol (COCI19_trol) | C++20 | 1 ms | 572 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD=360;
int main()
{
int t;
cin>>t;
while(t--){
ll l,r;
cin>>l>>r;
if(r-l<50){
ll cnt=0;
for(ll i=0;i<=r-l;i++){
cnt+=(l+i)%9==0? 9 : (l+i)%9;
}
cout<<cnt<<endl;
}
else{
ll cnt=0;
ll tot=r-l+1;
while(l%9!=1){
cnt+=l%9==0? 9 : l%9;
l++;
tot--;
}
while(r%9!=0){
cnt+=r%9==0? 9 : r%9;
r--;
tot--;
}
cout<<cnt+(tot*5)<<endl;
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
