#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
int get_jarisoo(int x){
if(x == 0) return 0;
int ans = 0;
while(x){
ans++;
x /= 10;
}
return ans;
}
lint pw[18];
int main(){
pw[0] = 1;
for(int i=1; i<18; i++) pw[i] = pw[i-1] * 10;
int q;
cin >> q;
while(q--){
int a, b;
cin >> a >> b;
int z = get_jarisoo(a);
bool ok = 0;
for(int i=0; i<16; i++){
if(a + pw[z + i] > b){
printf("%d\n", i);
ok = 1;
break;
}
}
if(!ok) puts("16");
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
201 ms |
372 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
201 ms |
372 KB |
Output isn't correct |
2 |
Incorrect |
201 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
196 ms |
460 KB |
Output isn't correct |
4 |
Incorrect |
191 ms |
488 KB |
Output isn't correct |
5 |
Incorrect |
180 ms |
488 KB |
Output isn't correct |
6 |
Incorrect |
199 ms |
488 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
201 ms |
372 KB |
Output isn't correct |
2 |
Incorrect |
201 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
196 ms |
460 KB |
Output isn't correct |
4 |
Incorrect |
191 ms |
488 KB |
Output isn't correct |
5 |
Incorrect |
180 ms |
488 KB |
Output isn't correct |
6 |
Incorrect |
199 ms |
488 KB |
Output isn't correct |
7 |
Incorrect |
207 ms |
512 KB |
Output isn't correct |
8 |
Incorrect |
206 ms |
512 KB |
Output isn't correct |
9 |
Incorrect |
206 ms |
640 KB |
Output isn't correct |
10 |
Incorrect |
212 ms |
640 KB |
Output isn't correct |
11 |
Incorrect |
203 ms |
640 KB |
Output isn't correct |