Submission #20522

# Submission time Handle Problem Language Result Execution time Memory
20522 2017-02-12T07:46:48 Z SD(#70, sang7) 채점 시스템 (OJUZ11_judge) C++14
31 / 100
43 ms 1116 KB
#include<cstdio>

long long mat[15];

int lenll(long long pi) {
	int cnt = 0;

	while (pi > 0)
	{
		pi /= 10;
		cnt++;
	}

	return cnt;
}

int Go(long long pi, long long ti)
{
	int cnt = 0;
	int len = lenll(pi);
	long long t = pi + mat[len];
	while (t < ti)
	{
		cnt++;
		len++;
		t = pi + mat[len];
	}
	return cnt;
}

int main() {

	mat[0] = 1;
	for (int i = 1; i < 15; i++)
	{
		mat[i] = mat[i - 1] * 10;
	}

	int N;
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
	{
		long long pi, ti;
		scanf("%lld %lld", &pi,&ti);
		printf("%d\n", Go(pi, ti));
	}
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:40:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
judge.cpp:44:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld", &pi,&ti);
                              ^
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1116 KB Output is correct
2 Incorrect 29 ms 1116 KB Output isn't correct
3 Incorrect 33 ms 1116 KB Output isn't correct
4 Incorrect 33 ms 1116 KB Output isn't correct
5 Incorrect 33 ms 1116 KB Output isn't correct
6 Incorrect 33 ms 1116 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1116 KB Output is correct
2 Incorrect 29 ms 1116 KB Output isn't correct
3 Incorrect 33 ms 1116 KB Output isn't correct
4 Incorrect 33 ms 1116 KB Output isn't correct
5 Incorrect 33 ms 1116 KB Output isn't correct
6 Incorrect 33 ms 1116 KB Output isn't correct
7 Incorrect 43 ms 1116 KB Output isn't correct
8 Incorrect 39 ms 1116 KB Output isn't correct
9 Incorrect 36 ms 1116 KB Output isn't correct
10 Incorrect 39 ms 1116 KB Output isn't correct
11 Incorrect 29 ms 1116 KB Output isn't correct