Submission #975614

#TimeUsernameProblemLanguageResultExecution timeMemory
975614vjudge1Trol (COCI19_trol)C++17
20 / 50
1077 ms348 KiB
#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 timeMemoryGrader output
Fetching results...