답안 #20373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20373 2017-02-07T09:49:52 Z 채점 시스템 (OJUZ11_judge) C++
100 / 100
62 ms 540 KB
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;

int N;
int main(){
	scanf("%d",&N);
	ll a,b;
	for(int i=0;i<N;i++){
		scanf("%lld %lld",&a,&b);
		
		ll sum=1,p;
		for(p=1;p<13;p++){
			sum*=10ll;
			if(sum>a)break;
		}
		
		int ans=0;
		while(sum+a<=b){
			ans++;
			sum*=10ll;
		}
		printf("%d\n",ans);

	}

	return 0;
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:8:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&N);
                ^
judge.cpp:11:27: 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 39 ms 444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 39 ms 444 KB Output is correct
2 Correct 55 ms 444 KB Output is correct
3 Correct 62 ms 512 KB Output is correct
4 Correct 48 ms 512 KB Output is correct
5 Correct 39 ms 512 KB Output is correct
6 Correct 38 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 39 ms 444 KB Output is correct
2 Correct 55 ms 444 KB Output is correct
3 Correct 62 ms 512 KB Output is correct
4 Correct 48 ms 512 KB Output is correct
5 Correct 39 ms 512 KB Output is correct
6 Correct 38 ms 512 KB Output is correct
7 Correct 44 ms 512 KB Output is correct
8 Correct 41 ms 540 KB Output is correct
9 Correct 41 ms 540 KB Output is correct
10 Correct 41 ms 540 KB Output is correct
11 Correct 33 ms 540 KB Output is correct