Submission #971917

# Submission time Handle Problem Language Result Execution time Memory
971917 2024-04-29T13:43:37 Z vjudge1 Trol (COCI19_trol) C++17
0 / 50
1 ms 348 KB
#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
1 Incorrect 1 ms 344 KB Output isn't correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Incorrect 1 ms 344 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct