답안 #974693

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974693 2024-05-03T16:07:44 Z vjudge1 Trol (COCI19_trol) C++17
0 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int q;
    unsigned long long l, r, res = 0;
    cin >> q;
    while (q--) {
        cin >> l >> r;
        unsigned long long quo, rem, tmp;
        quo = (r-l+1)/9;
        rem = (r-l+1)%9;
        tmp = (l-1)%9+1;
        res = 45*quo;
        while (rem--) {
            res += tmp;
            tmp = (tmp+1)%9;
        }
        cout << res << endl;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 344 KB Output isn't correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 0 ms 348 KB Output isn't correct