# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
975913 |
2024-05-06T03:14:19 Z |
vjudge1 |
Trol (COCI19_trol) |
C++17 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
int digitcalc(int n){
int ret = 0;
while(n!=0){
ret += n%10;
n/=10;
}
return ret;
}
signed main (){
int q; cin >> q;
for(int i = 0;i<q;i++){
int l,r; cin >> l >> r;
int prefr = 45*(r/9) + ((r%9) * ((r%9) + 1))/2;
l--;
int prefl = 45*(l/9) + ((l%9) * ((l%9) + 1))/2;
cout << prefr - prefl << 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 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |