Submission #210457

# Submission time Handle Problem Language Result Execution time Memory
210457 2020-03-17T11:48:39 Z itiam Trol (COCI19_trol) C++11
30 / 50
5 ms 256 KB
#include <bits/stdc++.h>

using namespace std;
int L[107];

int main(){
    int N,x,y;
    cin >> N;
    for (int i=0;i<N;i++){
        int zb=45,a,ost,br,z;
        cin >> x >> y;
        a=x%9;
        if (a==0)   a=9;
        z=a;
        br=(y-x)/9;
        ost=(y-x)%9;
        for (int j=a+1;j<a+1+ost;j++){
            z+=j;
            if (j>=10)  z-=9;
        }
        z+=(br*zb);
        L[i]=z;
    }
    for (int i=0;i<N;i++){
        if (i!=0)   cout << endl;
        cout << L[i];
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Incorrect 5 ms 256 KB Output isn't correct
4 Correct 5 ms 256 KB Output is correct
5 Incorrect 5 ms 256 KB Output isn't correct