結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-05-10 22:09:21 | 
| 言語 | Go (1.23.4) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 321 bytes | 
| コンパイル時間 | 10,427 ms | 
| コンパイル使用メモリ | 236,868 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-10 04:04:10 | 
| 合計ジャッジ時間 | 11,290 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 13 WA * 11 | 
ソースコード
package main
import (
	"fmt"
)
func main() {
	var x, y, d, ans int64
	fmt.Scanln(&x, &y, &d)
	if x+y < d {
		fmt.Println(0)
		return
	}
	if x >= d {
		if y >= d {
			ans = d
		} else {
			ans = y
		}
	} else if x < d {
		diff := d - x
		if y-diff > d {
			ans = d
		} else {
			ans = y
		}
	}
	fmt.Println(ans + 1)
}
            
            
            
        