| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1248690 | hayyy | Trol (COCI19_trol) | C++20 | 1095 ms | 468 KiB |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll balik(ll K, ll F) {
while (K > 0) {
F += K % 10;
K /= 10;
}
if (F > 9) return balik(F, 0);
else return F;
}
int main() {
ll N;
cin >> N;
ll A;
ll B;
for (ll i = 1; i <= N; i++) {
ll ans = 0;
cin >> A >> B;
int X = balik(A, 0);
int coba = B % 9;
// int bagi = B / 45;
// ans += bagi*45;
for (ll i = A; i <= B; i++) {
if (X > 9) X = 1;
ans += X;
X++;
}
cout << ans << endl;
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
