Submission #29868099
Source Code Expand
Copy
import java.util.Scanner;public class Main {public static void main(String[] args) {try (Scanner scanner = new Scanner(System.in)) {int a = scanner.nextInt(), b = scanner.nextInt(), c = scanner.nextInt(), x = scanner.nextInt();System.out.println((x <= a) ? 1.0d : ((x <= b) ? c / (double) (b - a) : 0.0d));}}}
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scanner = new Scanner(System.in)) { int a = scanner.nextInt(), b = scanner.nextInt(), c = scanner.nextInt(), x = scanner.nextInt(); System.out.println((x <= a) ? 1.0d : ((x <= b) ? c / (double) (b - a) : 0.0d)); } } }
Submission Info
Submission Time | |
---|---|
Task | A - T-shirt |
User | danielsun3164 |
Language | Java (OpenJDK 11.0.6) |
Score | 100 |
Code Size | 343 Byte |
Status | AC |
Exec Time | 262 ms |
Memory | 35844 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, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 262 ms | 35580 KB |
sample_02.txt | AC | 204 ms | 35844 KB |
sample_03.txt | AC | 220 ms | 35368 KB |
test_01.txt | AC | 202 ms | 35676 KB |
test_02.txt | AC | 183 ms | 35680 KB |
test_03.txt | AC | 204 ms | 35556 KB |
test_04.txt | AC | 191 ms | 35776 KB |
test_05.txt | AC | 200 ms | 35792 KB |
test_06.txt | AC | 205 ms | 35612 KB |
test_07.txt | AC | 194 ms | 35764 KB |
test_08.txt | AC | 187 ms | 35608 KB |
test_09.txt | AC | 190 ms | 35836 KB |
test_10.txt | AC | 207 ms | 35784 KB |
test_11.txt | AC | 190 ms | 35640 KB |
test_12.txt | AC | 160 ms | 35636 KB |
test_13.txt | AC | 166 ms | 35708 KB |
test_14.txt | AC | 164 ms | 35572 KB |
test_15.txt | AC | 178 ms | 35528 KB |