Submission #118540

# Submission time Handle Problem Language Result Execution time Memory
118540 2019-06-19T07:53:56 Z 임유진(#2901) Sequence (BOI14_sequence) C++14
0 / 100
7 ms 384 KB
#include<stdio.h>

#define MAXN 1000

int B[MAXN];

int main(){
	int K;
	
	scanf("%d", &K);
	for(int i=0; i<K; i++) scanf("%d", B+i);

	for(int i=1; i<=1000; i++){
		bool a=true;
		for(int j=0; j<K; j++){
			bool b=false;
			for(int k=1; k<=i; k*=10) if(((i+j)/k)%10==B[j]){
				b=true;
			}
			if(!b) a=false;
		}
		if(a){
			printf("%d\n", i);
			return 0;
		}
	}
	return 0;
}

Compilation message

sequence.cpp: In function 'int main()':
sequence.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &K);
  ~~~~~^~~~~~~~~~
sequence.cpp:11:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0; i<K; i++) scanf("%d", B+i);
                         ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 7 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 7 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Execution timed out 3 ms 256 KB Time limit exceeded (wall clock)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 7 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -