답안 #135219

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
135219 2019-07-23T20:20:36 Z FedericoS Money (IZhO17_money) C++14
0 / 100
2 ms 380 KB
#include <iostream>
#include <set>
using namespace std;

int N;
int A[1000006];
set<int> S;
int ans;

int main(){
	cin>>N;
	for(int i=0;i<N;i++)
		cin>>A[i];
	S.insert(N+1);

	for(int i=0;i<N-1;i++){
		if(A[i]>A[i+1])
			ans++;
		if(A[i]<A[i+1] and *S.lower_bound(A[i])<A[i+1])
			ans++;
		S.insert(A[i]);
	}

	cout<<ans+1;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Halted 0 ms 0 KB -