# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20570 | G (#35) | 채점 시스템 (OJUZ11_judge) | C++11 | 56 ms | 1116 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int digit(long long int x) {
if (x < 10)return 1;
return digit(x / 10) + 1;
}
long long int powt(int x) {
if (x == 0)return 1;
return powt(x - 1) * 10;
}
int main() {
int tcn;
scanf("%d", &tcn);
while (tcn--) {
long long int a, b;
scanf("%lld%lld", &a, &b);
int ans = 0;
while (1) {
if (a + powt(ans + digit(a)) > b)break;
ans++;
}
printf("%d\n", ans);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |