Submission #20413

#TimeUsernameProblemLanguageResultExecution timeMemory
20413tlwpdus (#35)채점 시스템 (OJUZ11_judge)C++98
100 / 100
56 ms1116 KiB
#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 (stderr)

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);
                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...