답안 #20413

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20413 2017-02-11T07:33:36 Z tlwpdus(#44, tlwpdus) 채점 시스템 (OJUZ11_judge) C++
100 / 100
56 ms 1116 KB
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<math.h>
 
using namespace std;
 
int n;
long long po[15];
 
int main() {
	int i;
	po[0] = 1;
	for (i=1;i<15;i++) po[i] = po[i-1]*10LL;
	scanf("%d",&n);
	for (i=0;i<n;i++) {
		long long rp, p, t;
		scanf("%lld%lld",&p,&t);
		rp = p;
		int rlen, len = 0;
		if (!p) len = 1;
		else {
			while(rp>0) {
				rp/=10;
				len++;
			}
		}
		rlen = len;
		for(;;len++) {
			if (po[len]+p>t) break;
		}
		printf("%d\n",len-rlen);
	}
 
	return 0;
}

Compilation message

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