Created
September 21, 2016 13:50
-
-
Save yurahuna/059452c1da1a82d0a8feb094642f3dc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int N, M, A, B; | |
cin >> N >> M >> A >> B; | |
vi D(N); | |
rep(i, N) cin >> D[i]; | |
int i; | |
for (i = 0; i < N && D[i] >= A; i++) { | |
; | |
} | |
if (N - i < M) { | |
for (i = i - 1 ; i >= 0 && D[i] <= B; i--) { | |
; | |
} | |
cout << i + 1 << endl; | |
} else { | |
cout << i << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment