#include<iostream>
#include<string>
using namespace std;
int main(void)
{
int n; cin >> n;
while (n--)
{
string a, b;
cin >> a >> b;
if (a.size() >= b.size())
{
cout << 0 << endl;
continue;
}
int cnt = b.size() - a.size() - 1;
string tmp;
for (int i = 0; i < cnt; i ++)
tmp.insert(0, 1, '0');
tmp.insert(0, 1, '1');
a.insert(0, tmp);
if (a > b)
cout << cnt << endl;
else
cout << cnt + 1 << endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
136 ms |
2020 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
136 ms |
2020 KB |
Output is correct |
2 |
Correct |
119 ms |
2020 KB |
Output is correct |
3 |
Correct |
166 ms |
2020 KB |
Output is correct |
4 |
Correct |
139 ms |
2020 KB |
Output is correct |
5 |
Correct |
106 ms |
2020 KB |
Output is correct |
6 |
Runtime error |
93 ms |
2020 KB |
Execution timed out (wall clock limit exceeded) |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
136 ms |
2020 KB |
Output is correct |
2 |
Correct |
119 ms |
2020 KB |
Output is correct |
3 |
Correct |
166 ms |
2020 KB |
Output is correct |
4 |
Correct |
139 ms |
2020 KB |
Output is correct |
5 |
Correct |
106 ms |
2020 KB |
Output is correct |
6 |
Runtime error |
93 ms |
2020 KB |
Execution timed out (wall clock limit exceeded) |
7 |
Runtime error |
133 ms |
2020 KB |
Execution timed out (wall clock limit exceeded) |
8 |
Correct |
133 ms |
2020 KB |
Output is correct |
9 |
Correct |
146 ms |
2020 KB |
Output is correct |
10 |
Correct |
159 ms |
2020 KB |
Output is correct |
11 |
Correct |
179 ms |
2020 KB |
Output is correct |