제출 #976627

#제출 시각아이디문제언어결과실행 시간메모리
976627vjudge1Trol (COCI19_trol)C++17
30 / 50
1067 ms600 KiB
#include <bits/stdc++.h> using namespace std; int main() { int Q; cin >> Q; while(Q--) { long long count=0; long long L, R; cin >> L >> R; for (long long i = L; i<=R; i++) { int hasil = 0; if (i < 10) { hasil = i; } else if (i % 9 == 0) { hasil = 9; } else { hasil = (i % 9); } count += hasil; } cout << count << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...