Submission #30850

# Submission time Handle Problem Language Result Execution time Memory
30850 2017-07-27T23:07:59 Z okaybody10 채점 시스템 (OJUZ11_judge) C++
78 / 100
1000 ms 1116 KB
#include <stdio.h>

int wkfltn(int n)
{
    int cnt=0;
    if(n==0)
        return 1;
    while(n)
    {
        n/=10;
        cnt++;
    }
    return cnt;
}

int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        int S,P;
        scanf("%d %d",&P,&S);
        int wkfl=wkfltn(P);
            int tenpow=1;
            for(int i=1;i<=wkfl;i++)
                tenpow*=10;
        int zerocount=0;
        while(1)
        {
            if(tenpow+P>S)
                break;
            zerocount++;
            tenpow*=10;
        }
        printf("%d\n",zerocount);
    }
    return 0;
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:19:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&T);
                   ^
judge.cpp:23:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&P,&S);
                             ^
# Verdict Execution time Memory Grader output
1 Correct 33 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 1116 KB Output is correct
2 Correct 39 ms 1116 KB Output is correct
3 Correct 36 ms 1116 KB Output is correct
4 Correct 43 ms 1116 KB Output is correct
5 Correct 53 ms 1116 KB Output is correct
6 Correct 36 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 1116 KB Output is correct
2 Correct 39 ms 1116 KB Output is correct
3 Correct 36 ms 1116 KB Output is correct
4 Correct 43 ms 1116 KB Output is correct
5 Correct 53 ms 1116 KB Output is correct
6 Correct 36 ms 1116 KB Output is correct
7 Execution timed out 1000 ms 1116 KB Execution timed out
8 Execution timed out 1000 ms 1116 KB Execution timed out
9 Execution timed out 1000 ms 1116 KB Execution timed out
10 Execution timed out 1000 ms 1116 KB Execution timed out
11 Execution timed out 1000 ms 1116 KB Execution timed out