# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20413 | 2017-02-11T07:33:36 Z | tlwpdus(#44, tlwpdus) | 채점 시스템 (OJUZ11_judge) | C++ | 56 ms | 1116 KB |
#include<stdio.h> #include<algorithm> #include<vector> #include<math.h> using namespace std; int n; long long po[15]; int main() { int i; po[0] = 1; for (i=1;i<15;i++) po[i] = po[i-1]*10LL; scanf("%d",&n); for (i=0;i<n;i++) { long long rp, p, t; scanf("%lld%lld",&p,&t); rp = p; int rlen, len = 0; if (!p) len = 1; else { while(rp>0) { rp/=10; len++; } } rlen = len; for(;;len++) { if (po[len]+p>t) break; } printf("%d\n",len-rlen); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 1116 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 1116 KB | Output is correct |
2 | Correct | 36 ms | 1116 KB | Output is correct |
3 | Correct | 56 ms | 1116 KB | Output is correct |
4 | Correct | 36 ms | 1116 KB | Output is correct |
5 | Correct | 29 ms | 1116 KB | Output is correct |
6 | Correct | 33 ms | 1116 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 1116 KB | Output is correct |
2 | Correct | 36 ms | 1116 KB | Output is correct |
3 | Correct | 56 ms | 1116 KB | Output is correct |
4 | Correct | 36 ms | 1116 KB | Output is correct |
5 | Correct | 29 ms | 1116 KB | Output is correct |
6 | Correct | 33 ms | 1116 KB | Output is correct |
7 | Correct | 39 ms | 1116 KB | Output is correct |
8 | Correct | 39 ms | 1116 KB | Output is correct |
9 | Correct | 39 ms | 1116 KB | Output is correct |
10 | Correct | 36 ms | 1116 KB | Output is correct |
11 | Correct | 33 ms | 1116 KB | Output is correct |