Submission #6516163
Source Code Expand
import CoreFoundation infix operator ** {} func **(lhs: Int, rhs: Double) -> Int { 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 | 465 Byte |
Status | CE |
Compile Error
./Main.swift:4:16: error: cannot convert value of type 'Int' to expected argument type 'Double' return pow(lhs, rhs) ^~~ ./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:10: error: cannot convert value of type 'Double' to expected argument type 'Int' 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] { ~~^~~