#include <bits/stdc++.h>
#define ll long long
using namespace std;
int q; ll l[105], r[105];
int main(){
cin >> q;
int sum=0;
for(int i=1; i<=q; i++){
cin >> l[i] >> r[i];
for(int j=l[i]; j<=r[i]; j++){
if(l[i] % 9 != 0){
sum += l[i] % 9;
}
else{
sum += l[i] % 10;
l[i] -= l[i] % 10;
sum += l[i] % 9;
}
l[i]++;
}
cout << sum << endl;
sum = 0;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Execution timed out |
1029 ms |
344 KB |
Time limit exceeded |
5 |
Execution timed out |
1046 ms |
348 KB |
Time limit exceeded |