Submission #6516171


Source Code Expand

import CoreFoundation
infix operator ** {}
func **(lhs: Double, rhs: Double) -> Double {
    return pow(lhs, rhs)
}
let input = readLine()!.characters.split(" ").map{Double(String($0))!}
var ans = "NO"
for _ in 0..<Int(readLine()!)! {
  let xy = readLine()!.characters.split(" ").map{Double(String($0))!}
  if ((xy[0]-input[0])**2+(xy[1]-input[1])**2)**0.5+((input[2]-xy[0])**2+(input[3]-xy[1])**2)*0.5 <= input[4]*input[5] {
    ans = "YES"
  }
}
print(ans)

Submission Info

Submission Time
Task C - 浮気調査
User Pine
Language Swift (swift-2.2-RELEASE)
Score 0
Code Size 471 Byte
Status CE

Compile Error

./Main.swift:10:23: error: non-associative operator is adjacent to operator of same precedence
  if ((xy[0]-input[0])**2+(xy[1]-input[1])**2)**0.5+((input[2]-xy[0])**2+(input[3]-xy[1])**2)*0.5 <= input[4]*input[5] {
                      ^
./Main.swift:10:70: error: non-associative operator is adjacent to operator of same precedence
  if ((xy[0]-input[0])**2+(xy[1]-input[1])**2)**0.5+((input[2]-xy[0])**2+(input[3]-xy[1])**2)*0.5 <= input[4]*input[5] {
                                                                     ^
./Main.swift:10:99: error: no '<=' candidates produce the expected contextual result type 'Double'
  if ((xy[0]-input[0])**2+(xy[1]-input[1])**2)**0.5+((input[2]-xy[0])**2+(input[3]-xy[1])**2)*0.5 <= input[4]*input[5] {
                                                                                                  ^
./Main.swift:10:99: note: produces result of type 'Bool'
  if ((xy[0]-input[0])**2+(xy[1]-input[1])**2)**0.5+((input[2]-xy[0])**2+(input[3]-xy[1])**2)*0.5 <= input[4]*input[5] {...