結果

提出番号 613
提出者 fal_rnd
言語 Java
提出日時 2017-07-27 13:38:50
問題名 (11)いわゆる検索
結果 MLE
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 284ms 123040KB
2 AC 100% 285ms 122720KB
3 MLE 0% 2546ms 404960KB
4 MLE 0% 2296ms 406336KB
5 MLE 0% 2684ms 429664KB
6 MLE 0% 2187ms 329872KB
7 MLE 0% 2613ms 333824KB
8 MLE 0% 1940ms 362512KB
9 MLE 0% 1995ms 381008KB
10 MLE 0% 2116ms 392000KB
11 MLE 0% 2341ms 371920KB
12 MLE 0% 2187ms 376576KB
13 MLE 0% 2440ms 336304KB
14 MLE 0% 2495ms 405696KB
15 MLE 0% 2161ms 306352KB
16 MLE 0% 2268ms 382688KB
17 MLE 0% 2133ms 335040KB
18 MLE 0% 2345ms 396144KB
19 MLE 0% 2181ms 333552KB
20 MLE 0% 2469ms 334688KB

ソースコード

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Main{
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());};
	static IntStream REPS(int n){return IntStream.range(0,n);};
	static IntStream REPS(int b,int e){return IntStream.rangeClosed(b,e);};
	static IntStream INS(int n){return IntStream.range(0,n).map(i->getInt());};

	public static void main(String[]$){
		int n=getInt();
		short[]a=new short[n];
		REPS(n).forEach(i->a[i]=(short)getInt());
 		INS(getInt()).map(i->{
			int v=Arrays.binarySearch(a,(short)i);
			return v<0?n-~v:n-v;
		}).forEach(System.out::println);
	}
}