# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
976002 |
2024-05-06T04:54:19 Z |
vjudge1 |
Trol (COCI19_trol) |
C++17 |
|
1000 ms |
348 KB |
#include <iostream>
using namespace std;
// Fungsi untuk mengubah bilangan menjadi bilangan dengan satu digit
int satuDigit(int n) {
while (n >= 10) {
int sum = 0;
while (n > 0) {
sum += n % 10;
n /= 10;
}
n = sum;
}
return n;
}
int main() {
int Q;
cin >> Q;
for (int i = 0; i < Q; ++i) {
long long L, R;
cin >> L >> R;
long long total = 0;
for (long long j = L; j <= R; ++j) {
total += satuDigit(j);
}
cout << total << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
4 |
Execution timed out |
1099 ms |
348 KB |
Time limit exceeded |
5 |
Execution timed out |
1030 ms |
344 KB |
Time limit exceeded |