Submission #68727

# Submission time Handle Problem Language Result Execution time Memory
68727 2018-08-18T09:44:26 Z 검수컵(#1978, imsifile) Box Run (FXCUP3_box) C++
17 / 100
1000 ms 576 KB
#include<stdio.h>

int N, ba[505050];

int main(){
	scanf("%d", &N);
	for(int i=0; i<N; i++) scanf("%d", &ba[i]);
	for(int i=1; i<=N; i++){
		int pv=1000000000, fl=1;
		for(int k=0; k<=N-i; k++){
			int mx=0;
			for(int j=k; j<k+i; j++){
				if(mx<ba[j]) mx=ba[j];
			}
			if(pv<mx){ printf("%d ", k); fl=0; break; }
			pv=mx;
		}
		if(fl) printf("-1 ");
	}
	return 0;
}

Compilation message

box.cpp: In function 'int main()':
box.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
  ~~~~~^~~~~~~~~~
box.cpp:7:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0; i<N; i++) scanf("%d", &ba[i]);
                         ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 2 ms 524 KB Output is correct
6 Correct 2 ms 524 KB Output is correct
7 Correct 2 ms 524 KB Output is correct
8 Correct 2 ms 524 KB Output is correct
9 Correct 2 ms 576 KB Output is correct
10 Correct 3 ms 576 KB Output is correct
11 Correct 3 ms 576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 2 ms 524 KB Output is correct
6 Correct 2 ms 524 KB Output is correct
7 Correct 2 ms 524 KB Output is correct
8 Correct 2 ms 524 KB Output is correct
9 Correct 2 ms 576 KB Output is correct
10 Correct 3 ms 576 KB Output is correct
11 Correct 3 ms 576 KB Output is correct
12 Correct 119 ms 576 KB Output is correct
13 Execution timed out 1064 ms 576 KB Time limit exceeded
14 Halted 0 ms 0 KB -