Submission #575166


Source Code Expand

Copy
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();

		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();

			if (a >= l && a <= h) {
				System.out.println(0);
			} else if (a > h) {
				System.out.println(-1);
			} else {
				System.out.println(l - a);
			}
		}

		sc.close();
	}
}

Submission Info

Submission Time
Task B - 運動管理
User garnacha
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 466 Byte
Status AC
Exec Time 639 ms
Memory 29312 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 20
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 639 ms 29208 KB
sample-02.txt AC 474 ms 28976 KB
test-01.txt AC 477 ms 29008 KB
test-02.txt AC 452 ms 29108 KB
test-03.txt AC 511 ms 28968 KB
test-04.txt AC 457 ms 28964 KB
test-05.txt AC 406 ms 28920 KB
test-06.txt AC 391 ms 29080 KB
test-07.txt AC 404 ms 29060 KB
test-08.txt AC 428 ms 29032 KB
test-09.txt AC 399 ms 28992 KB
test-10.txt AC 441 ms 29004 KB
test-11.txt AC 436 ms 29056 KB
test-12.txt AC 441 ms 29168 KB
test-13.txt AC 439 ms 28996 KB
test-14.txt AC 459 ms 29036 KB
test-15.txt AC 468 ms 29312 KB
test-16.txt AC 482 ms 28988 KB
test-17.txt AC 453 ms 29092 KB
test-18.txt AC 430 ms 28992 KB
test-19.txt AC 411 ms 29024 KB
test-20.txt AC 473 ms 29220 KB