Submission #976076

# Submission time Handle Problem Language Result Execution time Memory
976076 2024-05-06T07:05:57 Z vjudge1 Trol (COCI19_trol) C++17
0 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long

// 1-9=45
// 1-18=90

ll l,r;
ll solve(ll n){
    ll count,x,idx,sum=0;
    idx=n%9+1;
    while(idx--)sum+=idx;
    
    count=n/9;
    x= 45*count+sum;
    return x;   
}

int main(){
    ios
    ll t; cin >> t;
    while (t--){
        cin >> l >> r;
        cout << solve(r)-solve(l-1);
    }


    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct