結果

問題 No.512 魔法少女の追いかけっこ
ユーザー shirot7335shirot7335
提出日時 2017-05-06 21:13:43
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 897 bytes
コンパイル時間 13,834 ms
コンパイル使用メモリ 209,224 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 13:22:59
合計ジャッジ時間 13,264 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 1 ms
4,380 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 AC 1 ms
4,376 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 1 ms
4,376 KB
testcase_48 AC 1 ms
4,376 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func convH2S(speedH float64) float64 {
	return speedH / 60 / 60 / 1000
}

func judgeCandR(sections []float64, xs, ys float64) bool {
	for i := 0; i < len(sections)-2; i++ {
		kobaS := sections[i] / xs
		if ys*kobaS > sections[i+1] {
			return false
		}
	}
	return true
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	speed := strings.Fields(scanner.Text())
	x, _ := strconv.ParseFloat(speed[0], 32)
	y, _ := strconv.ParseFloat(speed[1], 32)

	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())

	scanner.Scan()
	sections := strings.Fields(scanner.Text())

	a := make([]float64, 0, n)
	for _, val := range sections {
		val, _ := strconv.ParseFloat(val, 32)
		a = append(a, val)
	}

	xs, ys := convH2S(x), convH2S(y)
	if judgeCandR(a, xs, ys) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
0