Submission #6516018


Source Code Expand

import Foundation
let input = readLine()!.characters.split(" ").map{Double(String($0))!}
let (txa, tya, txb, tyb, T, V) = (input[0], input[1], input[2], input[3], input[4], input[5])
let maxDist = V * T
let n = Int(readLine()!)!
var flag = false
for _ in 0..<n {
    let input = readLine()!.characters.split(" ").map{Double(String($0))!}
    let (x, y) = (input[0], input[1])
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
    if dist <= maxDist {
        flag = true
    }
}
print(flag ? "YES":"NO")

Submission Info

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

Compile Error

./Main.swift:10:16: error: use of unresolved identifier 'sqrt'
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
               ^~~~
./Main.swift:10:21: error: use of unresolved identifier 'pow'
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
                    ^~~
./Main.swift:10:37: error: use of unresolved identifier 'pow'
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
                                    ^~~
./Main.swift:10:54: error: use of unresolved identifier 'sqrt'
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
                                                     ^~~~
./Main.swift:10:59: error: use of unresolved identifier 'pow'
    let dist = sqrt(pow(x-txa, 2) + pow(y-tya, 2)) + sqrt(pow(txb-x, 2) + pow(tyb-y, 2))
                                                          ^~~
./Main.swift:10:75: error: use of unresolved identifier 'pow'
 ...