# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
976724 |
2024-05-07T04:10:32 Z |
vjudge1 |
Trol (COCI19_trol) |
C++17 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
#define debug cout << "here\n";
int main()
{
int q; cin >> q;
while(q--){
long long ans = 0;
long long l,r; cin >> l >> r;
while(l%9 != 1 && l <= r) {
if(l%9 == 0) {
ans += 9;
}else
ans += l%9;
l++;
}
while(r%9 != 0 && r > l) {
ans += r%9;
r--;
}
ans += 45 * ((r-l+1)/9);
cout << ans << '\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |