fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int N,L,x,k=-1;
  5. cin>>N>>L;
  6. for(int i=1;i<=N;i++){
  7. cin>>x;
  8. if(x<=L){
  9. k=i;
  10. break;
  11. }
  12. }
  13. cout<<k;
  14. return 0;
  15. }
Success #stdin #stdout 0s 5284KB
stdin
 3 5
 6 5 6
stdout
2