# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975614 | vjudge1 | Trol (COCI19_trol) | C++17 | 1077 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
ll l,r;
ll solve(ll x){
if(x>10){
x=(x-10)%9+1;
return solve(x);
}
else {
return x;
}
}
// if x>10
// x%10 + x/10
// 29490
// 303
// 33
// 6
// 11 13
// 24
// 6
// 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1(19) 2(20) 3 4 5 6 7 8 9 1(28) 2 3 4 5 6 7 8 9 1(37)
// b=9
// (x-10)%9;
// x=x+solve(i)
// i>n
// 721476
// 7 2 1
int main()
{
ios
ll n; cin >> n;
while (n--){
cin >> l >> r;
ll cnt=0;
for (int i=l; i<=r; i++){
cnt=cnt+ solve(i);
}
cout << cnt << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |