Submission #575406
Source Code Expand
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int L=sc.nextInt(); int H=sc.nextInt(); int N=sc.nextInt(); List<Integer> list=new ArrayList<Integer>(); for(int i=0;i<N;i++){ list.add(sc.nextInt()); } for(Integer i:list){ if(L<=i && i<= H){ System.out.println(0); }else if(i<L){ System.out.println(Math.abs(L-i)); }else{ System.out.println(-1); } } sc.close(); } }
Submission Info
Submission Time | |
---|---|
Task | B - 運動管理 |
User | sumi1375 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 100 |
Code Size | 572 Byte |
Status | AC |
Exec Time | 515 ms |
Memory | 29300 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt |
All | test-01.txt, test-02.txt, test-03.txt, test-04.txt, test-05.txt, test-06.txt, test-07.txt, test-08.txt, test-09.txt, test-10.txt, test-11.txt, test-12.txt, test-13.txt, test-14.txt, test-15.txt, test-16.txt, test-17.txt, test-18.txt, test-19.txt, test-20.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample-01.txt | AC | 430 ms | 29084 KB |
sample-02.txt | AC | 392 ms | 28984 KB |
test-01.txt | AC | 430 ms | 28940 KB |
test-02.txt | AC | 428 ms | 29032 KB |
test-03.txt | AC | 436 ms | 29072 KB |
test-04.txt | AC | 392 ms | 29020 KB |
test-05.txt | AC | 402 ms | 28936 KB |
test-06.txt | AC | 437 ms | 29040 KB |
test-07.txt | AC | 448 ms | 28964 KB |
test-08.txt | AC | 396 ms | 29100 KB |
test-09.txt | AC | 427 ms | 29112 KB |
test-10.txt | AC | 454 ms | 29068 KB |
test-11.txt | AC | 397 ms | 29076 KB |
test-12.txt | AC | 402 ms | 29096 KB |
test-13.txt | AC | 432 ms | 29204 KB |
test-14.txt | AC | 515 ms | 29300 KB |
test-15.txt | AC | 491 ms | 29088 KB |
test-16.txt | AC | 504 ms | 29236 KB |
test-17.txt | AC | 501 ms | 29120 KB |
test-18.txt | AC | 466 ms | 29148 KB |
test-19.txt | AC | 499 ms | 29080 KB |
test-20.txt | AC | 466 ms | 29208 KB |