# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20745 | sang7 | 채점 시스템 (OJUZ11_judge) | C++14 | 43 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<cstdio>
long long mat[15];
int lenll(long long pi) {
int cnt = 0;
while (pi > 0)
{
pi /= 10LL;
cnt++;
}
return cnt;
}
int Go(long long pi, long long ti)
{
int cnt = 0;
int len = lenll(pi);
long long t = pi + mat[len];
while (t <= ti)
{
cnt++;
len++;
t = pi + mat[len];
}
return cnt;
}
int main() {
mat[0] = 1;
for (int i = 1; i < 15; i++)
{
mat[i] = mat[i - 1] * 10LL;
}
mat[0] = 0;
int N;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
long long pi, ti;
scanf("%lld %lld", &pi,&ti);
printf("%d\n", Go(pi, ti));
}
}
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... |