Submission #180962
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AtCoderBeginnerContest010_C { class Program { static void Main(string[] args) { // 入力 var str0 = Console.ReadLine(); // 高橋君情報 var str1 = Console.ReadLine(); // 検査人数 int kensaCount = int.Parse(str1); string[] zahyo = new string[kensaCount]; // 人数分の座標読込 for (int i = 0; i < kensaCount; i++) { zahyo[i] = Console.ReadLine(); // 検査人数 } var kekka = false; string[] split0 = str0.Split(' '); // 高橋君のスタート位置 int startX = int.Parse(split0[0]); int startY = int.Parse(split0[1]); // 高橋君のゴール位置 int goalX = int.Parse(split0[2]); int goalY = int.Parse(split0[3]); // 高橋君の移動距離計算 int takahasiMove = int.Parse(split0[4]) * int.Parse(split0[5]); // 一人ずつのそこまでの移動距離計算と判定 for (int i = 0; i < kensaCount; i++) { var splitMokuteki = zahyo[i].Split(' '); int mokutekiX = int.Parse(splitMokuteki[0]); int mokutekiY = int.Parse(splitMokuteki[1]); var moveVal1 = Math.Sqrt(Math.Pow((mokutekiX - startX), 2) + Math.Pow((mokutekiY - startY), 2)); var moveVal2 = Math.Sqrt(Math.Pow((goalX -mokutekiX ), 2) + Math.Pow((goalY- mokutekiY), 2)); var moveVal = moveVal1 + moveVal2; // 寄り道可能判定 if (moveVal <= takahasiMove) { kekka = true; break; } } Console.WriteLine("{0}", (kekka == true ? "YES" : "NO")); } } }
Submission Info
Submission Time | |
---|---|
Task | C - 浮気調査 |
User | masayan |
Language | C# (Mono 2.10.8.1) |
Score | 100 |
Code Size | 2046 Byte |
Status | AC |
Exec Time | 140 ms |
Memory | 7692 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 | 124 ms | 7420 KB |
sample_02.txt | AC | 135 ms | 7492 KB |
sample_03.txt | AC | 127 ms | 7480 KB |
sample_04.txt | AC | 124 ms | 7488 KB |
test_01.txt | AC | 126 ms | 7692 KB |
test_02.txt | AC | 130 ms | 7548 KB |
test_03.txt | AC | 130 ms | 7492 KB |
test_04.txt | AC | 128 ms | 7488 KB |
test_05.txt | AC | 133 ms | 7560 KB |
test_06.txt | AC | 131 ms | 7584 KB |
test_07.txt | AC | 133 ms | 7620 KB |
test_08.txt | AC | 125 ms | 7492 KB |
test_09.txt | AC | 125 ms | 7496 KB |
test_10.txt | AC | 130 ms | 7488 KB |
test_11.txt | AC | 140 ms | 7608 KB |
test_12.txt | AC | 131 ms | 7432 KB |
test_13.txt | AC | 138 ms | 7632 KB |
test_14.txt | AC | 125 ms | 7492 KB |
test_15.txt | AC | 126 ms | 7552 KB |
test_16.txt | AC | 122 ms | 7468 KB |
test_17.txt | AC | 130 ms | 7492 KB |
test_18.txt | AC | 131 ms | 7508 KB |
test_19.txt | AC | 136 ms | 7688 KB |
test_20.txt | AC | 128 ms | 7564 KB |
test_21.txt | AC | 127 ms | 7620 KB |
test_22.txt | AC | 125 ms | 7436 KB |
test_23.txt | AC | 127 ms | 7612 KB |
test_24.txt | AC | 123 ms | 7548 KB |
test_25.txt | AC | 133 ms | 7680 KB |
test_26.txt | AC | 130 ms | 7484 KB |
test_27.txt | AC | 124 ms | 7616 KB |
test_28.txt | AC | 125 ms | 7480 KB |
test_29.txt | AC | 137 ms | 7548 KB |
test_30.txt | AC | 128 ms | 7552 KB |
test_31.txt | AC | 135 ms | 7424 KB |