Submission #1007333

#TimeUsernameProblemLanguageResultExecution timeMemory
1007333vjudge1Trol (COCI19_trol)C++17
20 / 50
1099 ms348 KiB
#include <iostream> #define ll long long using namespace std; // Fungsi untuk menghitung digit root int digit_root(int n) { return 1 + (n - 1) % 9; } int main() { int q; cin >> q; while (q--) { ll l, r; cin >> l >> r; ll ans = 0; for (ll i = l; i <= r; i++) { ans += digit_root(i); } cout << ans << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...