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