| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 208092 | dOAOb | Trol (COCI19_trol) | C++14 | 1089 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
using namespace std;
#define int long long
#ifdef lioraju
#define ndbg(x)
#else
#define ndbg(x) x
#endif
int f(int i)
{
if (i<10) return i;
int sum = 0;
while (i)
sum += i%10, i/=10;
return f(sum);
}
signed main()
{
ndbg( ios::sync_with_stdio(0); cin.tie(0); );
int q; cin>>q;
for (int qi=0; qi<q; qi++)
{
int l, r, sum = 0; cin>>l>>r;
for (int i=l;i<=r;i++)
sum += f(i);
cout<<sum<<'\n';
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
