Submission #20358

# Submission time Handle Problem Language Result Execution time Memory
20358 2017-02-07T07:58:56 Z 채점 시스템 (OJUZ11_judge) C++
0 / 100
232 ms 600 KB
#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");
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 384 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 384 KB -
2 Incorrect 199 ms 440 KB -
3 Incorrect 189 ms 440 KB -
4 Incorrect 206 ms 464 KB -
5 Incorrect 229 ms 472 KB -
6 Incorrect 211 ms 484 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 384 KB -
2 Incorrect 199 ms 440 KB -
3 Incorrect 189 ms 440 KB -
4 Incorrect 206 ms 464 KB -
5 Incorrect 229 ms 472 KB -
6 Incorrect 211 ms 484 KB -
7 Incorrect 207 ms 484 KB -
8 Incorrect 232 ms 484 KB -
9 Incorrect 196 ms 484 KB -
10 Incorrect 216 ms 484 KB -
11 Incorrect 216 ms 600 KB -