Submission #23362

# Submission time Handle Problem Language Result Execution time Memory
23362 2017-05-07T04:37:44 Z gs14004 채점 시스템 (OJUZ11_judge) C++11
0 / 100
206 ms 2020 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 1;
	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);
		for(int i=0; ; i++){
			if(a + pw[z + i] > b){
				printf("%d\n", i);
				break;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Runtime error 119 ms 2020 KB Execution timed out (wall clock limit exceeded)
# Verdict Execution time Memory Grader output
1 Runtime error 119 ms 2020 KB Execution timed out (wall clock limit exceeded)
2 Correct 179 ms 2020 KB Output is correct
3 Correct 176 ms 2020 KB Output is correct
4 Runtime error 126 ms 2020 KB Execution timed out (wall clock limit exceeded)
5 Runtime error 196 ms 2020 KB Execution timed out (wall clock limit exceeded)
6 Correct 126 ms 2020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 119 ms 2020 KB Execution timed out (wall clock limit exceeded)
2 Correct 179 ms 2020 KB Output is correct
3 Correct 176 ms 2020 KB Output is correct
4 Runtime error 126 ms 2020 KB Execution timed out (wall clock limit exceeded)
5 Runtime error 196 ms 2020 KB Execution timed out (wall clock limit exceeded)
6 Correct 126 ms 2020 KB Output is correct
7 Correct 166 ms 2020 KB Output is correct
8 Runtime error 186 ms 2020 KB Execution timed out (wall clock limit exceeded)
9 Correct 159 ms 2020 KB Output is correct
10 Runtime error 206 ms 2020 KB Execution timed out (wall clock limit exceeded)
11 Runtime error 169 ms 2020 KB Execution timed out (wall clock limit exceeded)