Submission #20536

# Submission time Handle Problem Language Result Execution time Memory
20536 2017-02-12T08:08:36 Z SD(#70, sang7) 채점 시스템 (OJUZ11_judge) C++14
0 / 100
179 ms 1116 KB
#include<cstdio>

long long mat[15];
int lenll(long long pi) {
	int cnt = 0;
	while (pi > 0)
	{
		pi /= 10LL;
		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] * 10LL;
	}
	mat[0] = 0;

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

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:38:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
judge.cpp:42: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 Runtime error 179 ms 1116 KB Execution timed out (wall clock limit exceeded)
# Verdict Execution time Memory Grader output
1 Runtime error 179 ms 1116 KB Execution timed out (wall clock limit exceeded)
2 Incorrect 143 ms 1116 KB Output isn't correct
3 Runtime error 126 ms 1116 KB Execution timed out (wall clock limit exceeded)
4 Runtime error 99 ms 1116 KB Execution timed out (wall clock limit exceeded)
5 Runtime error 129 ms 1116 KB Execution timed out (wall clock limit exceeded)
6 Runtime error 173 ms 1116 KB Execution timed out (wall clock limit exceeded)
# Verdict Execution time Memory Grader output
1 Runtime error 179 ms 1116 KB Execution timed out (wall clock limit exceeded)
2 Incorrect 143 ms 1116 KB Output isn't correct
3 Runtime error 126 ms 1116 KB Execution timed out (wall clock limit exceeded)
4 Runtime error 99 ms 1116 KB Execution timed out (wall clock limit exceeded)
5 Runtime error 129 ms 1116 KB Execution timed out (wall clock limit exceeded)
6 Runtime error 173 ms 1116 KB Execution timed out (wall clock limit exceeded)
7 Runtime error 166 ms 1116 KB Execution timed out (wall clock limit exceeded)
8 Runtime error 146 ms 1116 KB Execution timed out (wall clock limit exceeded)
9 Runtime error 159 ms 1116 KB Execution timed out (wall clock limit exceeded)
10 Runtime error 129 ms 1116 KB Execution timed out (wall clock limit exceeded)
11 Runtime error 66 ms 1116 KB Execution timed out (wall clock limit exceeded)