Submission #180679
Source Code Expand
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) throws IOException { ArrayList<String> strList = inToList(); String[] info = strList.get(0).split(" "); int[] takahashi = new int[]{Integer.parseInt(info[0]), Integer.parseInt(info[1])}; int[] nagisa = new int[]{Integer.parseInt(info[2]), Integer.parseInt(info[3])}; int min = Integer.parseInt(info[4]); int speed = Integer.parseInt(info[5]); List<String> girls = strList.subList(2, strList.size() - 1); for(String g : girls) { String[] ga = g.split(" "); int[] a = new int[]{Integer.parseInt(ga[0]), Integer.parseInt(ga[1])}; double dis = calcDis(takahashi[0], takahashi[1], a[0], a[1]) + calcDis(a[0], a[1], nagisa[0], nagisa[1]); if(dis > min*speed) { pln("YES"); return; } } pln("NO"); } static double calcDis(int x, int y, int x1, int y1) { return Math.sqrt(Math.pow(x1-x,2) + Math.pow(y1-y,2)); } static ArrayList<String> inToList() throws IOException { BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in)); ArrayList<String> strList = new ArrayList<>(); String line; while((line = stdReader.readLine()) != null) { strList.add(line); } return strList; } static <E> void p(E msg) { System.out.print(msg); } static <E> void pln(E msg) { System.out.println(msg); } }
Submission Info
Submission Time | |
---|---|
Task | C - 浮気調査 |
User | sakuna63 |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 1752 Byte |
Status | WA |
Exec Time | 434 ms |
Memory | 21820 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 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 | 434 ms | 20720 KB |
sample_02.txt | WA | 374 ms | 20636 KB |
sample_03.txt | WA | 373 ms | 20644 KB |
sample_04.txt | AC | 412 ms | 20620 KB |
test_01.txt | WA | 374 ms | 20760 KB |
test_02.txt | WA | 403 ms | 21820 KB |
test_03.txt | WA | 374 ms | 20708 KB |
test_04.txt | WA | 379 ms | 20708 KB |
test_05.txt | WA | 371 ms | 20680 KB |
test_06.txt | WA | 371 ms | 20676 KB |
test_07.txt | WA | 376 ms | 20660 KB |
test_08.txt | AC | 370 ms | 20696 KB |
test_09.txt | WA | 377 ms | 20756 KB |
test_10.txt | AC | 376 ms | 20824 KB |
test_11.txt | WA | 388 ms | 20748 KB |
test_12.txt | WA | 374 ms | 20692 KB |
test_13.txt | WA | 383 ms | 20824 KB |
test_14.txt | AC | 398 ms | 20744 KB |
test_15.txt | WA | 379 ms | 20756 KB |
test_16.txt | WA | 393 ms | 21084 KB |
test_17.txt | WA | 385 ms | 20688 KB |
test_18.txt | WA | 387 ms | 20712 KB |
test_19.txt | WA | 383 ms | 20700 KB |
test_20.txt | AC | 384 ms | 20816 KB |
test_21.txt | WA | 387 ms | 20828 KB |
test_22.txt | AC | 382 ms | 20596 KB |
test_23.txt | WA | 382 ms | 20708 KB |
test_24.txt | AC | 384 ms | 20632 KB |
test_25.txt | WA | 411 ms | 20672 KB |
test_26.txt | AC | 396 ms | 20840 KB |
test_27.txt | WA | 386 ms | 20804 KB |
test_28.txt | WA | 416 ms | 21292 KB |
test_29.txt | WA | 393 ms | 20696 KB |
test_30.txt | AC | 400 ms | 20588 KB |
test_31.txt | AC | 400 ms | 20552 KB |