답안 #975608

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975608 2024-05-05T14:27:43 Z vjudge1 Trol (COCI19_trol) C++17
10 / 50
1000 ms 428 KB
#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)+(x/10);
        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 10 11 12 13 14

// 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Execution timed out 1072 ms 348 KB Time limit exceeded
4 Execution timed out 1045 ms 428 KB Time limit exceeded
5 Execution timed out 1022 ms 348 KB Time limit exceeded