# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
975608 | vjudge1 | Trol (COCI19_trol) | C++17 | 1072 ms | 428 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |