답안 #20570

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20570 2017-02-12T11:09:45 Z G(#74, gs12117) 채점 시스템 (OJUZ11_judge) C++11
100 / 100
56 ms 1116 KB
#include<stdio.h>
int digit(long long int x) {
	if (x < 10)return 1;
	return digit(x / 10) + 1;
}
long long int powt(int x) {
	if (x == 0)return 1;
	return powt(x - 1) * 10;
}
int main() {
	int tcn;
	scanf("%d", &tcn);
	while (tcn--) {
		long long int a, b;
		scanf("%lld%lld", &a, &b);
		int ans = 0;
		while (1) {
			if (a + powt(ans + digit(a)) > b)break;
			ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:12:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &tcn);
                   ^
judge.cpp:15:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld%lld", &a, &b);
                            ^
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1116 KB Output is correct
2 Correct 33 ms 1116 KB Output is correct
3 Correct 36 ms 1116 KB Output is correct
4 Correct 33 ms 1116 KB Output is correct
5 Correct 29 ms 1116 KB Output is correct
6 Correct 36 ms 1116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1116 KB Output is correct
2 Correct 33 ms 1116 KB Output is correct
3 Correct 36 ms 1116 KB Output is correct
4 Correct 33 ms 1116 KB Output is correct
5 Correct 29 ms 1116 KB Output is correct
6 Correct 36 ms 1116 KB Output is correct
7 Correct 46 ms 1116 KB Output is correct
8 Correct 56 ms 1116 KB Output is correct
9 Correct 46 ms 1116 KB Output is correct
10 Correct 43 ms 1116 KB Output is correct
11 Correct 36 ms 1116 KB Output is correct