Skip to content

Instantly share code, notes, and snippets.

@PreSoichiSumi
Created April 26, 2016 08:20
Show Gist options
  • Save PreSoichiSumi/4e86447b7d47bed2b62a23e13c5f8a0b to your computer and use it in GitHub Desktop.
Save PreSoichiSumi/4e86447b7d47bed2b62a23e13c5f8a0b to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int[] H=new int[N];
for(int i=0;i<N;i++){
H[i]=sc.nextInt();
}
int X=sc.nextInt();
int i;
for(i=0;i<N;i++){
if(H[i]>X)
break;
}
System.out.println(i+1);
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment