# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971917 | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 348 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;
long long Q,L,R;
int main(){
cin>>Q;
for(long long i=1;i<=Q;i++){
cin>>L>>R;
//Cari dari 1-R
long long A = ((R/9)*45)+((R%9)*(R%9+1)/2);
//Cari Selisih/1-L
long long B = (((L-1)/9)*45)+((((L-1)%9)/2)*(((L-1)%9)+1));
cout<<A-B<<"\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |