結果

問題 No.208 王将
コンテスト
ユーザー fmhr
提出日時 2015-05-25 23:08:15
言語 Go
(1.26.1)
コンパイル:
env GOCACHE=/tmp go build _filename_
実行:
./Main
結果
WA  
実行時間 -
コード長 269 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 13,262 ms
コンパイル使用メモリ 272,032 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-26 21:29:41
合計ジャッジ時間 12,731 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import (
	"fmt"
	"math"
)

func main() {
	var x, y, x1, y1 float64
	fmt.Scan(&x, &y, &x1, &y1)
	var ans float64
	if (x == 0 && x1 == 0 && y > y1) || (y == 0 && y1 == 0 && x > x1) {
		ans += 2
	}
	ans += math.Abs(x1-x) + math.Abs(y1-y)
	fmt.Println(ans)
}
0