#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
int main(){
int q; cin>>q;
while(q--){
string l, r; cin>>l>>r;
ll m = stoi(l), n = stoi(r), sum=0;
ll total=n-m+1, st=m%9-1;
while(total--){
st++;
sum+=st;
}
cout<<sum<<endl;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Runtime error |
2 ms |
604 KB |
Execution killed with signal 6 |
4 |
Execution timed out |
1086 ms |
436 KB |
Time limit exceeded |
5 |
Runtime error |
2 ms |
604 KB |
Execution killed with signal 6 |