# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20636 | ?? (#35) | 채점 시스템 (OJUZ11_judge) | C++11 | 223 ms | 2020 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 <bits/stdc++.h>
using namespace std;
int T, A, B;
string ar[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
int main() {
scanf("%d", &T);
for(int i=0; i<T; i++) {
scanf("%d %d", &A, &B);
string s, t;
if(A == 0) s = "0";
while(A) s = ar[A % 10] + s, A /= 10;
while(B) t = ar[B % 10] + t, B /= 10;
int ans = 0;
for(int i=0;; i++) {
string u = s;
for(int j=0; j<i; j++) u = "0" + u;
if(u.length() >= t.length()) {ans = i; break;}
u = "1" + u;
if(u.length() == t.length() && u > t) {ans = i; break;}
}
printf("%d\n", ans);
}
}
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... |