Submission #180961
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); double tx_a = sc.nextInt(); double ty_a = sc.nextInt(); double tx_b = sc.nextInt(); double ty_b = sc.nextInt(); double T = sc.nextInt(); double V = sc.nextInt(); int N = sc.nextInt(); List<Integer> X = new ArrayList<>(); List<Integer> Y = new ArrayList<>(); for (int i = 1; i <= N * 2; i++) { if (i % 2 == 1 || i == 1) { X.add(sc.nextInt()); } else { Y.add(sc.nextInt()); } } boolean flag = false; double speed = T * V; for (int i = 0; i <= N - 1; i++) { double xNum = X.get(i); double yNum = Y.get(i); double girlHome = Math.sqrt((Math.pow(xNum - tx_a, 2)) + Math.pow((yNum - ty_a), 2)); double takahashi = Math.sqrt((Math.pow(tx_b - xNum, 2)) + Math.pow(ty_b - yNum, 2)); double walkable = girlHome + takahashi; if (speed >= walkable) { flag = true; break; } } if (flag) { System.out.println("YES"); } else { System.out.println("NO"); } } }
Submission Info
Submission Time | |
---|---|
Task | C - 浮気調査 |
User | cocoa_dahlia |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 1458 Byte |
Status | AC |
Exec Time | 636 ms |
Memory | 25956 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
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, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 454 ms | 23248 KB |
sample_02.txt | AC | 453 ms | 23392 KB |
sample_03.txt | AC | 458 ms | 23380 KB |
sample_04.txt | AC | 448 ms | 23256 KB |
test_01.txt | AC | 559 ms | 25692 KB |
test_02.txt | AC | 553 ms | 25824 KB |
test_03.txt | AC | 515 ms | 24536 KB |
test_04.txt | AC | 479 ms | 23908 KB |
test_05.txt | AC | 525 ms | 24460 KB |
test_06.txt | AC | 481 ms | 23268 KB |
test_07.txt | AC | 577 ms | 25688 KB |
test_08.txt | AC | 568 ms | 25948 KB |
test_09.txt | AC | 516 ms | 24140 KB |
test_10.txt | AC | 573 ms | 25572 KB |
test_11.txt | AC | 459 ms | 23520 KB |
test_12.txt | AC | 467 ms | 23388 KB |
test_13.txt | AC | 554 ms | 25944 KB |
test_14.txt | AC | 563 ms | 25948 KB |
test_15.txt | AC | 477 ms | 23904 KB |
test_16.txt | AC | 514 ms | 24676 KB |
test_17.txt | AC | 487 ms | 24032 KB |
test_18.txt | AC | 471 ms | 23384 KB |
test_19.txt | AC | 636 ms | 25748 KB |
test_20.txt | AC | 582 ms | 25828 KB |
test_21.txt | AC | 564 ms | 25956 KB |
test_22.txt | AC | 478 ms | 23468 KB |
test_23.txt | AC | 465 ms | 23392 KB |
test_24.txt | AC | 453 ms | 23412 KB |
test_25.txt | AC | 583 ms | 25760 KB |
test_26.txt | AC | 550 ms | 25632 KB |
test_27.txt | AC | 557 ms | 24920 KB |
test_28.txt | AC | 546 ms | 24884 KB |
test_29.txt | AC | 493 ms | 23996 KB |
test_30.txt | AC | 459 ms | 23356 KB |
test_31.txt | AC | 453 ms | 23388 KB |