Submission #2865496
Source Code Expand
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int X = sc.nextInt(); int[] A = new int[M+1]; for(int i=1;i<=M;i++) A[i]=sc.nextInt(); int pos = 0; while(X>A[pos]) pos++; int ans = Math.min(pos-1,M-(pos-1)); System.out.println(ans); } }
Submission Info
Submission Time | |
---|---|
Task | B - Toll Gates |
User | AlbertZ |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 486 Byte |
Status | AC |
Exec Time | 106 ms |
Memory | 21972 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
1.txt | AC | 94 ms | 18640 KB |
2.txt | AC | 95 ms | 21844 KB |
3.txt | AC | 95 ms | 18900 KB |
4.txt | AC | 95 ms | 21332 KB |
5.txt | AC | 93 ms | 19924 KB |
6.txt | AC | 106 ms | 20820 KB |
7.txt | AC | 98 ms | 21972 KB |
8.txt | AC | 97 ms | 19924 KB |
sample1.txt | AC | 92 ms | 19156 KB |
sample2.txt | AC | 93 ms | 16852 KB |
sample3.txt | AC | 94 ms | 19540 KB |